-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassertions.http
More file actions
41 lines (36 loc) · 1.04 KB
/
Copy pathassertions.http
File metadata and controls
41 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@base = https://httpbin.org
###
# @name assertStatusNoBody
# @assert status == 204
# @assert status != 500
# @assert body not_exists
GET {{base}}/status/204
###
# @name assertPlainTextBody
# @assert status == 200
# @assert body exists
# @assert body == hello
# @assert body not_contains error
GET {{base}}/base64/aGVsbG8=
###
# @name assertJSONPayload
# @assert status >= 200
# @assert status < 300
# @assert body contains demo
# @assert json.json.name == "demo"
# @assert json.json.count >= 2
# @assert json.json.count <= 2
# @assert json.json.enabled == true
# @assert json.json.tags exists
# @assert json.json.missing not_exists
POST {{base}}/anything/assertions
Content-Type: application/json
{"name":"demo","count":2,"enabled":true,"tags":["one","two"]}
###
# @name assertHeaders
# @assert status == 200
# @assert header.X-Trace-Id exists
# @assert header.X-Trace-Id == trace-123
# @assert header.Content-Type contains "application/json"
# @assert header.X-Not-Set not_exists
GET {{base}}/response-headers?X-Trace-Id=trace-123&Content-Type=application/json