@@ -107,21 +107,21 @@ describe('TODO api testing', () => {
107
107
108
108
``` yaml
109
109
---
110
- - name : fetches TODO items - GET
110
+ - title : fetches TODO items - GET
111
111
GET : /todos/
112
112
asserts : # Asserts accepts a list of expressions, usually via json_paths to identify the items being refered to.
113
113
ok : $.resp.status == 200 # Rely on an expressions libray for parsing expressions
114
114
array : $.resp.json
115
115
exports : # values which should be accesible to future steps.
116
116
todoItem : $.resp.json[0]._id
117
117
118
- - name : deletes TODO items - DELETE
118
+ - title : deletes TODO items - DELETE
119
119
DELETE : /todos/$.stages[0].todoItem # relative syntax exists: $.stages[-1].todoItem, -1 means one stage before me
120
120
asserts :
121
121
empty : $.resp.json.todos
122
122
string : $.resp.json
123
123
124
- - name : Adds Todo item - POST
124
+ - title : Adds Todo item - POST
125
125
POST : /todos/
126
126
json :
127
127
task : " run tests"
@@ -137,21 +137,21 @@ describe('TODO api testing', () => {
137
137
138
138
` ` ` yaml
139
139
---
140
- - name : fetches TODO items - GET
140
+ - title : fetches TODO items - GET
141
141
GET: /todos/
142
142
asserts:
143
143
ok: $.resp.status == 200
144
144
array: $.resp.json
145
145
exports:
146
146
todoItem: $.resp.json[0]._id
147
147
148
- - name : deletes TODO items - DELETE
148
+ - title : deletes TODO items - DELETE
149
149
DELETE: /todos/$.stages[0].todoItem
150
150
asserts:
151
151
empty: $.resp.json.todos
152
152
string: $.resp.json
153
153
154
- - name : Adds Todo item - POST
154
+ - title : Adds Todo item - POST
155
155
POST: /todos/
156
156
json:
157
157
task: "run tests"
@@ -200,11 +200,11 @@ The `request` field in `testkit` defines the API request to be made and consists
200
200
201
201
` ` ` yaml
202
202
# POST request
203
- - name : Adds Todo item - POST
203
+ - title : Adds Todo item - POST
204
204
POST: /todos/
205
205
206
206
# GET request
207
- - name : Fetches Todo items - GET
207
+ - title : Fetches Todo items - GET
208
208
GET: /todos/
209
209
` ` `
210
210
@@ -213,7 +213,7 @@ The `request` field in `testkit` defines the API request to be made and consists
213
213
Example :
214
214
215
215
` ` ` yaml
216
- - name : Fetches Todo items - GET with headers
216
+ - title : Fetches Todo items - GET with headers
217
217
GET: /todos/
218
218
headers:
219
219
Authorization: Bearer <token>
@@ -228,7 +228,7 @@ The `request` field in `testkit` defines the API request to be made and consists
228
228
Here's an example illustrating the usage of the `json` property :
229
229
230
230
` ` ` yaml
231
- - name : Create User - POST
231
+ - title : Create User - POST
232
232
POST: /users/
233
233
json:
234
234
name: John Doe
@@ -251,7 +251,7 @@ The `asserts` field accepts a collection of key-value pairs, where the keys repr
251
251
Here's an example to demonstrate the usage of the `asserts` field :
252
252
253
253
` ` ` yaml
254
- - name : Fetches Todo items - GET
254
+ - title : Fetches Todo items - GET
255
255
GET: /todos/
256
256
asserts:
257
257
ok: $.resp.status == 200
@@ -294,7 +294,7 @@ To use the `exports` field, you define key-value pairs where the keys represent
294
294
Here's an example that demonstrates the usage of the `exports` field :
295
295
296
296
` ` ` yaml
297
- - name : Fetches Todo items - GET
297
+ - title : Fetches Todo items - GET
298
298
GET: /todos/
299
299
exports:
300
300
todoItem: $.resp.json[0]._id
@@ -317,7 +317,7 @@ By capturing relevant data using the `exports` field, you can store it as an exp
317
317
For example, let's say you retrieve an ID from an API response in one stage using the `exports` field :
318
318
319
319
` ` ` yaml
320
- - name : Fetch User - GET
320
+ - title : Fetch User - GET
321
321
GET: /users/1
322
322
exports:
323
323
userId: $.resp.body.id
@@ -326,7 +326,7 @@ For example, let's say you retrieve an ID from an API response in one stage usin
326
326
To reference this `userId` export in a subsequent API request, you can use the `$.stages[n].<VAL>` syntax :
327
327
328
328
` ` ` yaml
329
- - name : Update User - PUT
329
+ - title : Update User - PUT
330
330
PUT: /users/$.stages[0].userId
331
331
json:
332
332
name: 'John Doe'
@@ -338,7 +338,7 @@ You can also use relative references like `$.stages[-n]` which refers to the `ex
338
338
Example :
339
339
340
340
` ` ` yaml
341
- - name : deletes TODO items - DELETE
341
+ - title : deletes TODO items - DELETE
342
342
DELETE: /todos/$.stages[-1].todoItem #-1 means one stage before me
343
343
asserts:
344
344
string: $.resp.json.task
@@ -353,7 +353,7 @@ To make date assertions in Testkit you'll need to provided the date string and t
353
353
Example :
354
354
355
355
` ` ` yaml
356
- - name : Get User Profile - GET
356
+ - title : Get User Profile - GET
357
357
GET: /user/jon_doe
358
358
asserts:
359
359
date: $.resp.json.createdAt %Y-%m-%d %H:%M:%S %Z
@@ -423,7 +423,7 @@ To utilize environment variables in Testkit, you can access them using the follo
423
423
Example :
424
424
425
425
` ` ` yaml
426
- - name : Register
426
+ - title : Register
427
427
POST: '$.env.APIURL/users'
428
428
headers:
429
429
Content-Type: application/json
0 commit comments