mirror of
https://github.com/LukasKanka/api_test.git
synced 2026-11-11 06:34:36 +01:00
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
info:
|
|
name: ShortingHat
|
|
type: http
|
|
seq: 2
|
|
|
|
http:
|
|
method: GET
|
|
url: http://localhost:3000/sortingHat
|
|
auth: inherit
|
|
|
|
runtime:
|
|
scripts:
|
|
- type: tests
|
|
code: |-
|
|
const status = res.getStatus()
|
|
const body = res.getBody()
|
|
|
|
test("Status code is 200", function() {
|
|
expect(status).to.equal(200);
|
|
});
|
|
|
|
test("Response should contain sortingHat key", function(){
|
|
expect(body).to.contain.key("sortingHatSays")
|
|
})
|
|
|
|
test("Message from sorting hat should not be empty", function(){
|
|
expect(body.sortingHatSays).not.to.be.empty
|
|
})
|
|
|
|
test("Message from house should not be empty", function(){
|
|
expect(body.house).not.to.be.empty
|
|
})
|
|
|
|
test("House is one of Gryffindor, Slytherin, Ravenclaw, Hufflepuff",function(){
|
|
expect(body.house).is.oneOf(["Gryffindor", "Slytherin", "Ravenclaw", "Hufflepuff" ])
|
|
})
|
|
|
|
// Ověřím odpověď do 550 ms
|
|
test("Response time is less than 550 ms", function(){
|
|
expect(res.responseTime).to.be.below(550)
|
|
})
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
forwardAuthorizationHeader: false
|