Skip to content

Commit 99d0496

Browse files
committed
MAGETWO-98522: Adding out of stock items to comparison shows success message but fails
- Added automated test script.
1 parent e9de16a commit 99d0496

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AddOutOfStockProductToCompareListTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Adding to compare list if a product is out of stock"/>
15+
<description value="Adding to compare list if a product is out of stock"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-98644"/>
18+
<useCaseId value="MAGETWO-98522"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<createData entity="ApiCategory" stepKey="category"/>
24+
<createData entity="SimpleOutOfStockProduct" stepKey="product">
25+
<requiredEntity createDataKey="category"/>
26+
</createData>
27+
</before>
28+
<after>
29+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
30+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
31+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
32+
</after>
33+
34+
<!--Check 'out of stock' is turned off by default-->
35+
<actionGroup ref="noDisplayOutOfStockProduct" stepKey="noDisplayOutOfStockProduct"/>
36+
37+
<!--Open product page-->
38+
<amOnPage url="$$product.name$$.html" stepKey="goToSimpleProductPage"/>
39+
<waitForPageLoad stepKey="waitForSimpleProductPage"/>
40+
41+
<!--'Add to compare' link is not available-->
42+
<dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/>
43+
44+
<!--Turn on 'out of stock' config-->
45+
<actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/>
46+
47+
<!--Clear cache-->
48+
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCache" />
49+
50+
<!--Open product page-->
51+
<amOnPage url="$$product.name$$.html" stepKey="goToSimpleProductPage2"/>
52+
<waitForPageLoad stepKey="waitForSimpleProductPage2"/>
53+
54+
<!--Click on 'Add to Compare' link-->
55+
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/>
56+
57+
<!--See product in the comparison list-->
58+
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
59+
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList"/>
60+
</test>
61+
</tests>

0 commit comments

Comments
 (0)