4. Made with by PGS Software · 4
Process Collaboration
• Tester
• Developer
• Product Owner
The Three Amigos
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. Made with by PGS Software · 6
BDD
• Test scenarios using Gherkin
language
Process
Scenarios
7. Made with by PGS Software · 7
Wiremock
• Implementing step definitions
against mocks
Process
Mocks
8. Made with by PGS Software · 8
Process Swagger
• API documentation
Documentation
https://swagger.io/
9. Made with by PGS Software · 9
Process Presenting results
• feedback
Demo
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. 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. 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. Made with by PGS Software · 13
Approach HTTP requests
• Java library for handling REST web
services calls
REST Assured
14. Made with by PGS Software · 14
Approach Assertion matchers
• assertThat
Hamcrest
@Test
public void checkResponse(String message) {
assertThat(response, containsString(message));
}
15. Made with by PGS Software · 15
Approach Checking JSON
• Comparing the whole file
• Comparing values
JSON
Actual
result
Expected
result
16. Made with by PGS Software · 16
Tools Demo
Swagger
Wiremock
17. Made with by PGS Software · 17
Tools
Jenkins
Jenkins Pipeline
• Wiremock job