Skip to content

Commit 987f4c8

Browse files
committed
MQE-2613: assertions.md doc update
1 parent 357f1ce commit 987f4c8

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

dev/tests/verification/Resources/AssertTest.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,13 @@ class AssertTestCest
151151
$I->assertNotEqualsCanonicalizing(["5", "8", "7", "9"], ["1", "2", "3", "4"], "pass"); // stepKey: a4
152152
$I->assertEqualsIgnoringCase("Cat", "cat", "pass"); // stepKey: a5
153153
$I->assertNotEqualsIgnoringCase("Cat", "Dog", "pass"); // stepKey: a6
154+
$I->comment("assertions.md examples");
155+
$I->assertElementContainsAttribute(".admin__menu-overlay", "style", "color: #333;"); // stepKey: assertElementContainsAttribute
156+
$I->assertStringContainsString("Buy 5 for $5.00 each and save 50%", $DropDownTierPriceTextProduct1); // stepKey: assertDropDownTierPriceTextProduct1
157+
$I->assertEmpty("$grabSearchButtonAttribute"); // stepKey: assertSearchButtonEnabled
158+
$I->assertGreaterThanOrEqual($getOrderStatusFirstRow, $getOrderStatusSecondRow); // stepKey: checkStatusSortOrderAsc
159+
$I->assertNotEquals($grabTotalBefore, $grabTotalAfter); // stepKey: assertNotEqualsExample
160+
$I->assertNotRegExp('/placeholder\/thumbnail\.jpg/', $getSimpleProductThumbnail); // stepKey: simpleThumbnailIsNotDefault
161+
$I->assertRegExp("#var\s+adminAnalyticsMetadata\s+=\s+{\s+(\"[\w_]+\":\s+\"[^\"]*?\",\s+)*?(\"[\w_]+\":\s+\"[^\"]*?\"\s+)};#s", $pageSource, "adminAnalyticsMetadata object is invalid"); // stepKey: validateadminAnalyticsMetadata
154162
}
155163
}

dev/tests/verification/TestModule/Test/AssertTest.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,5 +400,33 @@
400400
<expectedResult type="string">Cat</expectedResult>
401401
<actualResult type="string">Dog</actualResult>
402402
</assertNotEqualsIgnoringCase>
403+
404+
<!-- assertions.md examples -->
405+
<assertElementContainsAttribute stepKey="assertElementContainsAttribute">
406+
<expectedResult selector=".admin__menu-overlay" attribute="style" type="string">color: #333;</expectedResult>
407+
</assertElementContainsAttribute>
408+
<assertStringContainsString stepKey="assertDropDownTierPriceTextProduct1">
409+
<expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult>
410+
<actualResult type="variable">DropDownTierPriceTextProduct1</actualResult>
411+
</assertStringContainsString>
412+
<assertEmpty stepKey="assertSearchButtonEnabled">
413+
<actualResult type="string">$grabSearchButtonAttribute</actualResult>
414+
</assertEmpty>
415+
<assertGreaterThanOrEqual stepKey="checkStatusSortOrderAsc">
416+
<actualResult type="const">$getOrderStatusSecondRow</actualResult>
417+
<expectedResult type="const">$getOrderStatusFirstRow</expectedResult>
418+
</assertGreaterThanOrEqual>
419+
<assertNotEquals stepKey="assertNotEqualsExample">
420+
<actualResult type="string">{$grabTotalAfter}</actualResult>
421+
<expectedResult type="string">{$grabTotalBefore}</expectedResult>
422+
</assertNotEquals>
423+
<assertNotRegExp stepKey="simpleThumbnailIsNotDefault">
424+
<actualResult type="const">$getSimpleProductThumbnail</actualResult>
425+
<expectedResult type="const">'/placeholder\/thumbnail\.jpg/'</expectedResult>
426+
</assertNotRegExp>
427+
<assertRegExp message="adminAnalyticsMetadata object is invalid" stepKey="validateadminAnalyticsMetadata">
428+
<expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?("[\w_]+":\s+"[^"]*?"\s+)};#s</expectedResult>
429+
<actualResult type="variable">$pageSource</actualResult>
430+
</assertRegExp>
403431
</test>
404432
</tests>

0 commit comments

Comments
 (0)