Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TGT#18 - BDD with The Three Amigos in API Testing - Julia Szarlej

158 views

Published on

TGT#18 - BDD with The Three Amigos in API Testing - Julia Szarlej
tgt.org.pl

Published in: Technology
  • Be the first to comment

  • Be the first to like this

TGT#18 - BDD with The Three Amigos in API Testing - Julia Szarlej

  1. 1. BDD with The Three Amigos in API testing Julia Szarlej · QA
  2. 2. Made with by PGS Software ·START FROM SCRATCH 2 Backend
  3. 3. Agenda
  4. 4. Made with by PGS Software · 4 Process Collaboration • Tester • Developer • Product Owner The Three Amigos
  5. 5. Made with by PGS Software · Customer Implementation Requirements Brainstorm 5 BDD with The Three Amigos STEP 1 STEP 2 STEP 3 STEP 4
  6. 6. Made with by PGS Software · 6 BDD • Test scenarios using Gherkin language Process Scenarios
  7. 7. Made with by PGS Software · 7 Wiremock • Implementing step definitions against mocks Process Mocks
  8. 8. Made with by PGS Software · 8 Process Swagger • API documentation Documentation https://swagger.io/
  9. 9. Made with by PGS Software · 9 Process Presenting results • feedback Demo
  10. 10. Made with by PGS Software · 10 BDD Checking expected responses Given I have a valid engine number When I request for the engine’s details Then The response shows the details of my favourite engine Positive scenarios
  11. 11. Made with by PGS Software · 11 BDD Error handling Given I have an engine number that does not exist in the engines database When I request for the engine’s details Then the error code is „404” And the response is an error „Engine Not Found” Negative scenarios
  12. 12. Before BBD scenario with 120 lines After BDD scenario with 4 lines Given an engine number And the value „A” is „1” And the value „B” is „2” And the value „C” is „3” And the value „D” is „4” And the value „E” is „5” And the value „F” is „6” And the value „G” is „7” ... When the request is made Then the value „1” is „10” And the value „2” is „20” And the value „3” is „30” And the value „4” is „40” And the value „5” is „50” And the value „6” is „60” And the value „7” is „70” And the value „8” is „80” And the value „9” is „90” ... Given I have an engine number And the request body When I request for engine’s details Then The response shows the details of my favourite engine
  13. 13. Made with by PGS Software · 13 Approach HTTP requests • Java library for handling REST web services calls REST Assured
  14. 14. Made with by PGS Software · 14 Approach Assertion matchers • assertThat Hamcrest @Test public void checkResponse(String message) { assertThat(response, containsString(message)); }
  15. 15. Made with by PGS Software · 15 Approach Checking JSON • Comparing the whole file • Comparing values JSON Actual result Expected result
  16. 16. Made with by PGS Software · 16 Tools Demo Swagger Wiremock
  17. 17. Made with by PGS Software · 17 Tools Jenkins Jenkins Pipeline • Wiremock job
  18. 18. ChallengesAdvantages
  19. 19. Made with by PGS Software ·ADVANTAGES 19 Tests can be implemented in parallel, usually finished first
  20. 20. Made with by PGS Software ·ADVANTAGES 20 Early defect detection and correction
  21. 21. Made with by PGS Software ·ADVANTAGES 21 Business point of view makes test scenarios better
  22. 22. Made with by PGS Software ·CHALLENGES 22 Switching from mock to real implementation
  23. 23. Made with by PGS Software ·CHALLENGES 23 Implementing scenarios not always easy
  24. 24. Made with by PGS Software · 24 You are The Really Useful Tester!
  25. 25. Thank you! Julia Szarlej Go visit pgs-soft.com

×