mirror of
https://github.com/LukasKanka/api_test.git
synced 2026-11-11 06:34:36 +01:00
AI
This commit is contained in:
1 parent
4b7af6ee7a
commit
2e185b47ef
12 files changed
+213
-6
No files matched your search
@@ -0,0 +1,47 @@
|
||||
info:
|
||||
name: AI - Get spells list
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://localhost:3000/spells
|
||||
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 be an array", function(){
|
||||
expect(body).to.be.an('array')
|
||||
})
|
||||
|
||||
test("Array should not be empty", function(){
|
||||
expect(body).to.not.be.empty
|
||||
})
|
||||
|
||||
test("Array should have at least 10 spells", function(){
|
||||
expect(body.length).to.be.at.least(10)
|
||||
})
|
||||
|
||||
test("First item should have spell key", function(){
|
||||
expect(body[0]).to.contain.key("spell")
|
||||
})
|
||||
|
||||
test("First item should have type key", function(){
|
||||
expect(body[0]).to.contain.key("type")
|
||||
})
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
forwardAuthorizationHeader: false
|
||||
@@ -0,0 +1,47 @@
|
||||
info:
|
||||
name: AI - Get random house
|
||||
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 sortingHatSays key", function(){
|
||||
expect(body).to.contain.key("sortingHatSays")
|
||||
})
|
||||
|
||||
test("Response should contain house key", function(){
|
||||
expect(body).to.contain.key("house")
|
||||
})
|
||||
|
||||
test("sortingHatSays should not be empty", function(){
|
||||
expect(body.sortingHatSays).not.to.be.empty
|
||||
})
|
||||
|
||||
test("House should be one of the four Hogwarts houses", function(){
|
||||
expect(body.house).is.oneOf(["Gryffindor", "Slytherin", "Ravenclaw", "Hufflepuff"])
|
||||
})
|
||||
|
||||
test("Response time is less than 600 ms", function(){
|
||||
expect(res.responseTime).to.be.below(600)
|
||||
})
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
forwardAuthorizationHeader: false
|
||||
@@ -0,0 +1,43 @@
|
||||
info:
|
||||
name: AI - Get random quote
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://localhost:3000/quote
|
||||
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 author key", function(){
|
||||
expect(body).to.contain.key("author")
|
||||
})
|
||||
|
||||
test("Response should contain quote key", function(){
|
||||
expect(body).to.contain.key("quote")
|
||||
})
|
||||
|
||||
test("Author should not be empty", function(){
|
||||
expect(body.author).not.to.be.empty
|
||||
})
|
||||
|
||||
test("Quote should not be empty", function(){
|
||||
expect(body.quote).not.to.be.empty
|
||||
})
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
forwardAuthorizationHeader: false
|
||||
@@ -0,0 +1,7 @@
|
||||
info:
|
||||
name: AI
|
||||
type: folder
|
||||
seq: 3
|
||||
|
||||
request:
|
||||
auth: inherit
|
||||
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
||||
info:
|
||||
name: Get specific spell
|
||||
type: http
|
||||
seq: 3
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
@@ -1,7 +1,7 @@
|
||||
info:
|
||||
name: Get spells
|
||||
type: http
|
||||
seq: 2
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
@@ -1,7 +1,7 @@
|
||||
info:
|
||||
name: ShortingHat
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: GET
|
||||
@@ -0,0 +1,7 @@
|
||||
info:
|
||||
name: GET
|
||||
type: folder
|
||||
seq: 1
|
||||
|
||||
request:
|
||||
auth: inherit
|
||||
@@ -1,7 +1,7 @@
|
||||
info:
|
||||
name: Add new sprll
|
||||
type: http
|
||||
seq: 5
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: POST
|
||||
@@ -0,0 +1,7 @@
|
||||
info:
|
||||
name: POST
|
||||
type: folder
|
||||
seq: 2
|
||||
|
||||
request:
|
||||
auth: inherit
|
||||
Reference in new issue
Block a user