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,41 @@
|
||||
info:
|
||||
name: Get spells
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://localhost:3000/spells?type=Curse&limit=2
|
||||
params:
|
||||
- name: type
|
||||
value: Curse
|
||||
type: query
|
||||
- name: limit
|
||||
value: "2"
|
||||
type: query
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: |-
|
||||
const body = res.getBody()
|
||||
|
||||
// Ověřím že se mi vrací Curse z (Query Params)
|
||||
test("Each spell should have type Curse", function(){
|
||||
body.forEach(spellMember => expect(spellMember.type).to.eql("Curse"))
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Ověřím že se mi vrací pouze 2 záznamy (limit)
|
||||
test("Response should contain exactly 2 spells", function(){
|
||||
expect(body).has.length(2)
|
||||
});
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
forwardAuthorizationHeader: false
|
||||
Reference in new issue
Block a user