You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checks if `actual` is of type boolean, meaning either _True_ or _False_.
216
-
217
-
```yaml
218
-
spec:
219
-
...
220
-
asserts:
221
-
- {type: AssertIsBool, actual: $Response.varOne}
222
-
```
223
-
224
-
### AssertCount
225
-
226
-
Checks if `actual` is countable, and have the number of elements given in `expected`. One particular use-case is to test short list of paginated items. Let's say a JSON node `articles` should contains a list of 5 items, then someone would write that as:
227
-
228
-
```yaml
229
-
spec:
230
-
...
231
-
asserts:
232
-
- type: AssertCount
233
-
actual: $Response.articles
234
-
expected: 5
235
-
```
236
-
237
-
`AssertCount`also can be use to check a JSON object have given number of keys, as well.
238
-
239
-
### AssertGreater
240
-
241
-
Checks if `actual` is only greater than `expected` value. Integer, floating point, decimal values can be compared.
242
-
243
-
```yaml
244
-
spec:
245
-
...
246
-
asserts:
247
-
- type: AssertGreater
248
-
actual: $Price
249
-
expected: 500
250
-
```
251
-
252
-
### AssertGreaterOrEqual
253
-
254
-
Checks if `actual` is greater than or equal to `expected` value. Integer, floating point, decimal values can be compared.
255
-
256
-
```yaml
257
-
spec:
258
-
...
259
-
asserts:
260
-
- type: AssertGreaterOrEqual
261
-
actual: $Price
262
-
expected: 500
263
-
```
264
-
265
-
### AssertLess
266
-
267
-
Checks if `actual` is only less than `expected` value. Integer, floating point, decimal values can be compared.
268
-
269
-
```yaml
270
-
spec:
271
-
...
272
-
asserts:
273
-
- type: AssertLess
274
-
actual: $Price
275
-
expected: 500
276
-
```
277
-
278
-
### AssertLessOrEqual
279
-
280
-
Checks if `actual` is less than or equal to `expected` value. Integer, floating point, decimal values can be compared.
281
-
282
-
```yaml
283
-
spec:
284
-
...
285
-
asserts:
286
-
- type: AssertLessOrEqual
287
-
actual: $Price
288
-
expected: 500
289
-
```
290
-
291
-
### AssertStrContains
292
-
293
-
Checks if data given in `actual` is a string. If so, does it contains the substring given in `expected`.
294
-
295
-
```yaml
296
-
spec:
297
-
...
298
-
asserts:
299
-
- type: AssertStrContains
300
-
actual: "testing is great for code"
301
-
expected: 'code'
302
-
```
303
-
304
-
### AssertIsList
305
-
306
-
Checks if `actual` is of type dictionary. Usually, JSON lists are list.
307
-
308
-
```yaml
309
-
spec:
310
-
...
311
-
asserts:
312
-
- {type: AssertIsList, actual: $Response}
313
-
```
314
-
315
-
### AssertListContains
316
-
317
-
Checks if data given in `actual` is a list. If so, does it contains the value given in `expected`.
318
-
319
-
```yaml
320
-
spec:
321
-
...
322
-
asserts:
323
-
- type: AssertListContains
324
-
actual: $Countries
325
-
expected: 'GB'
326
-
327
-
- type: AssertListContains
328
-
actual: $Currency
329
-
expected: {"country": "GB", "currency": "GBP"}
330
-
```
331
-
332
-
### AssertListHasIndex
333
-
334
-
Checks if data given in `actual` is a list. If so, does it contains `expected` index.
335
-
336
-
```yaml
337
-
spec:
338
-
...
339
-
asserts:
340
-
- type: AssertListHasIndex
341
-
actual: $Articles
342
-
expected: 6
343
-
```
344
-
345
-
### AssertIsMap
346
-
347
-
Checks if `actual` is of type dictionary. Usually, JSON objects are dictionary.
348
-
349
-
```yaml
350
-
spec:
351
-
...
352
-
asserts:
353
-
- {type: AssertIsMap, actual: $Response}
354
-
```
355
-
356
-
### AssertMapContains
357
-
358
-
Checks if data given in `actual` is a JSON object or dictionary. If so, does it contains a value given in `expected`.
Checks if data given in `actual` is a JSON object or dictionary. If so, does it contains all of keys given in `expected`. `expected` have to be a list of string.
Checks if data given in `actual` is a JSON object or dictionary. If so, it DOES NOT contains any of keys given in `expected`. `expected` have to be a list of string.
Checks if data given in `actual` is a JSON object or dictionary. If so, it only contains keys given in `expected`. `expected` have to be a list of string.
0 commit comments