Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Don't you like Integration testing as Me&

Avatar for Yevhen Yevhen
March 12, 2018

Don't you like Integration testing as Me&

Slides of public talk at SeleniumCamp 2018

Avatar for Yevhen

Yevhen

March 12, 2018

Other Decks in Technology

Transcript

  1. Yevhen Rudiev • QA Automation Lead at GamePoint • ~6

    years experience in IT • ~3 years experience in Automated Testing • ~2 years experience in Micro- Service architecture
  2. FAIL INVESTIGATION Test Failed: PaymentStatus was not updated to Captured

    in 30 seconds Expected: Captured Actual: Refused
  3. • New unstable version • WebRequest.Timeout • Delayed responses •

    Test Data changes • Hardware issues STABILITY
  4. BEHAVIOR CONTEXT [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)

    .WithBehavior(req => BehaviorHelper.Set(req.PaymentId, PaymentStatus.Captured)) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
  5. PRICE: • Higher tech level of QA • Increased time

    of development • More code to support • Synchronize Changes
  6. System under test #3 SMART FAKES DB Test Fake of

    Provider Verification of request
  7. #3.1 ISupportLogging [Test] public void VisaDeposit_Positive_PaymentCaptured() { . . .

    var request = FakeHelper.GetRequest(payment.Id); AssertRequest(request); } public void AssertRequest(HttpRequest request)
  8. #3.2 ISupportValidation public void ProcessRequest(HttpContext context) { if (!IsValidRequest(context.Request)) {

    return BadRequest(“Request violates the contract”); } return BehaviorContext.Response(context.Request.PaymentId); }
  9. #3.2 ISupportValidation [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)

    .WithBehavior(req => BehaviorHelper.Set(req.PaymentId, PaymentStatus.Captured)) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
  10. #3.3 PLUSSES: • All plusses from Fakes approach: • Fast

    • Stable • Controlled • Request verification
  11. #3.4 BLIND SPOTS: • Changes in the contracts on prod

    • New integration testing • Documentation errors
  12. RESULTS • Made our tests faster, more stable and controlled

    • Fakes guaranteed integration compatibility • Lives became easier
  13. Q&A