-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoschedule.hurl
52 lines (46 loc) · 1.35 KB
/
autoschedule.hurl
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
42
43
44
45
46
47
48
49
50
51
52
# /auto-schedule -----------------
POST {{BASE_URL}}/auto-schedule
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
{
"schedule": ["18:06z", "21:01Z"],
"daysOfWeek": [0,1,2,3,4,5,6],
"excludeDates": ["04/04/2024"],
"title": "greatschedule"
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.message" exists
jsonpath "$.title" exists
jsonpath "$.schedule" exists
jsonpath "$.daysOfWeek" exists
jsonpath "$.excludeDates" exists
[Captures]
title: jsonpath "$['title']"
schedule: jsonpath "$['schedule']"
daysOfWeek: jsonpath "$['daysOfWeek']"
excludeDates: jsonpath "$['excludeDates']"
GET {{BASE_URL}}/auto-schedule
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.schedules" exists
jsonpath "$.schedules.{{title}}.schedule" == {{schedule}}
jsonpath "$.schedules.{{title}}.daysOfWeek" == {{daysOfWeek}}
jsonpath "$.schedules.{{title}}.excludeDates" == {{excludeDates}}
DELETE {{BASE_URL}}/auto-schedule
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
{
"title": "{{title}}"
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
# -----------------------