Scenario: [1:8]
Add pet
ms: 622
>>
Background:
4
* url url_rest_api
1
15:16:38.610 browser = firefox
15:16:38.611 engine = selenium
15:16:38.611 headless = true
9
* def payload =
25
{
"id": 5432,
"name": "doggie",
"status": "available"
}
17
Given url url_rest_api
1
18
And request payload
1
19
When method post
582
15:16:38.832 request:
1 > POST https://petstore.swagger.io/v2/pet
1 > Content-Type: application/json; charset=UTF-8
1 > Content-Length: 48
1 > Host: petstore.swagger.io
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.15)
1 > Accept-Encoding: gzip,deflate
{"id":5432,"name":"doggie","status":"available"}
15:16:39.233 response time in milliseconds: 398
1 < 200
1 < Date: Tue, 26 Aug 2025 15:16:39 GMT
1 < Content-Type: application/json
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < Access-Control-Allow-Origin: *
1 < Access-Control-Allow-Methods: GET, POST, DELETE, PUT
1 < Access-Control-Allow-Headers: Content-Type, api_key, Authorization
1 < Server: Jetty(9.2.9.v20150224)
{"id":5432,"name":"doggie","photoUrls":[],"tags":[],"status":"available"}
20
* def id = response.id
2
21
Then status 200
0
22
And match response contains {id: 5432}
10
23
And match response contains {name: "doggie"}
1
24
And match response contains {status: "available"}
1