@@ -51,6 +51,8 @@ The following example shows a common test that gets text from a page and asserts
51
51
52
52
### assertElementContainsAttribute
53
53
54
+ The ` <assertElementContainsAttribute> ` asserts that the selected html element contains and matches the expected value for the given attribute.
55
+
54
56
Example:
55
57
56
58
``` xml
@@ -92,7 +94,8 @@ It must be in typical array format like `[1,2,3,4,5]` or `[alpha, brontosaurus,
92
94
See [ assertArrayHasKey docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertArrayHasKey )
93
95
94
96
Attribute|Type|Use|Description
95
- ---|---|---|---` message ` |string|optional|Text of informational message about a cause of failure.
97
+ ---|---|---|---
98
+ ` message ` |string|optional|Text of informational message about a cause of failure.
96
99
` stepKey ` |string|required| A unique identifier of the text step.
97
100
` before ` |string|optional| ` stepKey ` of action that must be executed next.
98
101
` after ` |string|optional| ` stepKey ` of the preceding action.
@@ -123,6 +126,15 @@ Attribute|Type|Use|Description
123
126
124
127
See [ assertStringContainsString docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertStringContainsString ) .
125
128
129
+ Example:
130
+
131
+ ``` xml
132
+ <assertStringContainsString stepKey =" assertDropDownTierPriceTextProduct1" >
133
+ <expectedResult type =" string" >Buy 5 for $5.00 each and save 50%</expectedResult >
134
+ <actualResult type =" variable" >DropDownTierPriceTextProduct1</actualResult >
135
+ </assertStringContainsString >
136
+ ```
137
+
126
138
Attribute|Type|Use|Description
127
139
---|---|---|---
128
140
` message ` |string|optional|Text describing the cause of the failure.
@@ -134,6 +146,15 @@ Attribute|Type|Use|Description
134
146
135
147
See [ assertStringContainsStringIgnoringCase docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertStringContainsStringIgnoringCase ) .
136
148
149
+ Example:
150
+
151
+ ``` xml
152
+ <assertStringContainsStringIgnoringCase stepKey =" verifyContentType" >
153
+ <actualResult type =" variable" >grabContentType</actualResult >
154
+ <expectedResult type =" string" >{{image.extension}}</expectedResult >
155
+ </assertStringContainsStringIgnoringCase >
156
+ ```
157
+
137
158
Attribute|Type|Use|Description
138
159
---|---|---|---
139
160
` message ` |string|optional|Message describing the cause of failure.
@@ -156,6 +177,14 @@ Attribute|Type|Use|Description
156
177
157
178
See [ assertEmpty docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertEmpty ) .
158
179
180
+ Example:
181
+
182
+ ``` xml
183
+ <assertEmpty stepKey =" assertSearchButtonEnabled" >
184
+ <actualResult type =" string" >$grabSearchButtonAttribute</actualResult >
185
+ </assertEmpty >
186
+ ```
187
+
159
188
Attribute|Type|Use|Description
160
189
---|---|---|---
161
190
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -167,6 +196,15 @@ Attribute|Type|Use|Description
167
196
168
197
See [ assertEquals docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertEquals ) .
169
198
199
+ Example:
200
+
201
+ ``` xml
202
+ <assertEquals message =" ExpectedPrice" stepKey =" assertBundleProductPrice" >
203
+ <actualResult type =" variable" >grabProductPrice</actualResult >
204
+ <expectedResult type =" string" >$75.00</expectedResult >
205
+ </assertEquals >
206
+ ```
207
+
170
208
Attribute|Type|Use|Description
171
209
---|---|---|---
172
210
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -245,6 +283,15 @@ Attribute|Type|Use|Description
245
283
246
284
See [ assertGreaterOrEquals docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertGreaterOrEquals ) .
247
285
286
+ Example:
287
+
288
+ ``` xml
289
+ <assertGreaterOrEquals stepKey =" checkStatusSortOrderAsc" after =" getOrderStatusSecondRow" >
290
+ <actualResult type =" const" >$getOrderStatusSecondRow</actualResult >
291
+ <expectedResult type =" const" >$getOrderStatusFirstRow</expectedResult >
292
+ </assertGreaterOrEquals >
293
+ ```
294
+
248
295
Attribute|Type|Use|Description
249
296
---|---|---|---
250
297
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -256,6 +303,15 @@ Attribute|Type|Use|Description
256
303
257
304
See [ assertGreaterThan docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertGreaterThan ) .
258
305
306
+ Example:
307
+
308
+ ``` xml
309
+ <assertGreaterThan stepKey =" checkQuantityWasChanged" >
310
+ <actualResult type =" const" >$grabEndQuantity</actualResult >
311
+ <expectedResult type =" const" >$grabStartQuantity</expectedResult >
312
+ </assertGreaterThan >
313
+ ```
314
+
259
315
Attribute|Type|Use|Description
260
316
---|---|---|---
261
317
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -267,6 +323,15 @@ Attribute|Type|Use|Description
267
323
268
324
See [ assertGreaterThanOrEqual docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertGreaterThanOrEqual ) .
269
325
326
+ Example:
327
+
328
+ ``` xml
329
+ <assertGreaterThanOrEqual stepKey =" checkStatusSortOrderAsc" after =" getOrderStatusSecondRow" >
330
+ <actualResult type =" const" >$getOrderStatusSecondRow</actualResult >
331
+ <expectedResult type =" const" >$getOrderStatusFirstRow</expectedResult >
332
+ </assertGreaterThanOrEqual >
333
+ ```
334
+
270
335
Attribute|Type|Use|Description
271
336
---|---|---|---
272
337
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -300,6 +365,15 @@ Attribute|Type|Use|Description
300
365
301
366
See [ assertLessOrEquals docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertLessOrEquals ) .
302
367
368
+ Example:
369
+
370
+ ``` xml
371
+ <assertLessOrEquals stepKey =" checkHeightIsCorrect" >
372
+ <actualResult type =" variable" >getImageHeight</actualResult >
373
+ <expectedResult type =" variable" >getSectionHeight</expectedResult >
374
+ </assertLessOrEquals >
375
+ ```
376
+
303
377
Attribute|Type|Use|Description
304
378
---|---|---|---
305
379
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -311,6 +385,15 @@ Attribute|Type|Use|Description
311
385
312
386
See [ assertLessThan docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertLessThan ) .
313
387
388
+ Example:
389
+
390
+ ``` xml
391
+ <assertLessThan stepKey =" assertLessImages" >
392
+ <expectedResult type =" variable" >initialImages</expectedResult >
393
+ <actualResult type =" variable" >newImages</actualResult >
394
+ </assertLessThan >
395
+ ```
396
+
314
397
Attribute|Type|Use|Description
315
398
---|---|---|---
316
399
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -322,6 +405,15 @@ Attribute|Type|Use|Description
322
405
323
406
See [ assertLessThanOrEqual docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertLessThanOrEqual ) .
324
407
408
+ Example:
409
+
410
+ ``` xml
411
+ <assertLessThanOrEqual stepKey =" checkHeightIsCorrect" >
412
+ <actualResult type =" variable" >getImageHeight</actualResult >
413
+ <expectedResult type =" variable" >getSectionHeight</expectedResult >
414
+ </assertLessThanOrEqual >
415
+ ```
416
+
325
417
Attribute|Type|Use|Description
326
418
---|---|---|---
327
419
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -333,6 +425,15 @@ Attribute|Type|Use|Description
333
425
334
426
See [ assertNotContains docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertNotContains ) .
335
427
428
+ Example:
429
+
430
+ ``` xml
431
+ <assertNotContains stepKey =" assertCustomerGroupNotInOptions" >
432
+ <actualResult type =" variable" >customerGroups</actualResult >
433
+ <expectedResult type =" string" >{{customerGroup.code}}</expectedResult >
434
+ </assertNotContains >
435
+ ```
436
+
336
437
Attribute|Type|Use|Description
337
438
---|---|---|---
338
439
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -344,6 +445,15 @@ Attribute|Type|Use|Description
344
445
345
446
See [ assertStringNotContainsString docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertStringNotContainsString ) .
346
447
448
+ Example:
449
+
450
+ ``` xml
451
+ <assertStringNotContainsString stepKey =" checkoutAsGuest" >
452
+ <expectedResult type =" string" >{{CaptchaData.checkoutAsGuest}}</expectedResult >
453
+ <actualResult type =" variable" >$formItems</actualResult >
454
+ </assertStringNotContainsString >
455
+ ```
456
+
347
457
Attribute|Type|Use|Description
348
458
---|---|---|---
349
459
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -355,6 +465,15 @@ Attribute|Type|Use|Description
355
465
356
466
See [ assertStringNotContainsStringIgnoringCase docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertStringNotContainsStringIgnoringCase ) .
357
467
468
+ Example:
469
+
470
+ ``` xml
471
+ <assertStringContainsStringIgnoringCase stepKey =" verifyContentType" >
472
+ <actualResult type =" variable" >grabContentType</actualResult >
473
+ <expectedResult type =" string" >{{image.extension}}</expectedResult >
474
+ </assertStringContainsStringIgnoringCase >
475
+ ```
476
+
358
477
Attribute|Type|Use|Description
359
478
---|---|---|---
360
479
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -366,6 +485,14 @@ Attribute|Type|Use|Description
366
485
367
486
See [ assertNotEmpty docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertNotEmpty ) .
368
487
488
+ Example:
489
+
490
+ ``` xml
491
+ <assertNotEmpty stepKey =" checkSwatchFieldForAdmin" >
492
+ <actualResult type =" const" >$grabSwatchForAdmin</actualResult >
493
+ </assertNotEmpty >
494
+ ```
495
+
369
496
Attribute|Type|Use|Description
370
497
---|---|---|---
371
498
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -377,6 +504,15 @@ Attribute|Type|Use|Description
377
504
378
505
See [ assertNotEquals docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertNotEquals ) .
379
506
507
+ Example:
508
+
509
+ ``` xml
510
+ <assertNotEquals stepKey =" assertNotEquals" >
511
+ <actualResult type =" string" >{$grabTotalAfter}</actualResult >
512
+ <expectedResult type =" string" >{$grabTotalBefore}</expectedResult >
513
+ </assertNotEquals >
514
+ ```
515
+
380
516
Attribute|Type|Use|Description
381
517
---|---|---|---
382
518
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -444,6 +580,15 @@ Attribute|Type|Use|Description
444
580
445
581
See [ assertNotRegExp docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertNotRegExp ) .
446
582
583
+ Example:
584
+
585
+ ``` xml
586
+ <assertNotRegExp stepKey =" simpleThumbnailIsNotDefault" >
587
+ <actualResult type =" const" >$getSimpleProductThumbnail</actualResult >
588
+ <expectedResult type =" const" >'/placeholder\/thumbnail\.jpg/'</expectedResult >
589
+ </assertNotRegExp >
590
+ ```
591
+
447
592
Attribute|Type|Use|Description
448
593
---|---|---|---
449
594
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -477,6 +622,15 @@ Attribute|Type|Use|Description
477
622
478
623
See [ assertRegExp docs on codeception.com] ( http://codeception.com/docs/modules/Asserts#assertRegExp ) .
479
624
625
+ Example:
626
+
627
+ ``` xml
628
+ <assertRegExp message =" adminAnalyticsMetadata object is invalid" stepKey =" validateadminAnalyticsMetadata" >
629
+ <expectedResult type =" string" >#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?("[\w_]+":\s+"[^"]*?"\s+)};#s</expectedResult >
630
+ <actualResult type =" variable" >$pageSource</actualResult >
631
+ </assertRegExp >
632
+ ```
633
+
480
634
Attribute|Type|Use|Description
481
635
---|---|---|---
482
636
` message ` |string|optional|Text of informational message about a cause of failure.
@@ -530,7 +684,7 @@ Attribute|Type|Use|Description
530
684
531
685
### expectException
532
686
533
- See [ expectException docs on codeception.com] ( http ://codeception.com/docs/modules/WebDriver #expectException) .
687
+ See [ expectException docs on codeception.com] ( https ://codeception.com/docs/modules/Asserts #expectException) .
534
688
535
689
Attribute|Type|Use|Description
536
690
---|---|---|---
@@ -540,7 +694,7 @@ Attribute|Type|Use|Description
540
694
541
695
### fail
542
696
543
- See [ fail docs on codeception.com] ( http ://codeception.com/docs/modules/WebDriver #fail) .
697
+ See [ fail docs on codeception.com] ( https ://codeception.com/docs/modules/Asserts #fail) .
544
698
545
699
Attribute|Type|Use|Description
546
700
---|---|---|---
0 commit comments