Skip to content

Commit e8b34ff

Browse files
Merge branch 'MAGETWO-98522' of https://git.epam.com/magn-m23/magn-m23 into MAGETWO-98522
2 parents 2f93680 + e0ae403 commit e8b34ff

File tree

1 file changed

+54
-23
lines changed

1 file changed

+54
-23
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,88 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AddOutOfStockProductToCompareListTest">
1212
<annotations>
1313
<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"/>
14+
<title value="Add out of stock product to compare list"/>
15+
<description value="Add out of stock product to compare list"/>
1616
<severity value="MAJOR"/>
1717
<testCaseId value="MAGETWO-98644"/>
1818
<useCaseId value="MAGETWO-98522"/>
1919
<group value="Catalog"/>
2020
</annotations>
2121
<before>
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23-
<createData entity="ApiCategory" stepKey="category"/>
24-
<createData entity="SimpleOutOfStockProduct" stepKey="product">
23+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 0" stepKey="displayOutOfStockNo"/>
24+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
25+
<createData entity="SimpleSubCategory" stepKey="category"/>
26+
<createData entity="SimpleProduct4" stepKey="product">
2527
<requiredEntity createDataKey="category"/>
2628
</createData>
2729
</before>
2830
<after>
29-
<actionGroup ref="noDisplayOutOfStockProduct" stepKey="noDisplayOutOfStockProduct"/>
31+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 0" stepKey="displayOutOfStockNo2"/>
32+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3033
<deleteData createDataKey="product" stepKey="deleteProduct"/>
3134
<deleteData createDataKey="category" stepKey="deleteCategory"/>
32-
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
35+
<actionGroup ref="logout" stepKey="logout"/>
3336
</after>
34-
35-
<!--Check 'out of stock' is turned off by default-->
36-
<actionGroup ref="noDisplayOutOfStockProduct" stepKey="noDisplayOutOfStockProduct"/>
37-
3837
<!--Open product page-->
39-
<amOnPage url="$$product.name$$.html" stepKey="goToSimpleProductPage"/>
38+
<comment userInput="Open product page" stepKey="openProdPage"/>
39+
<amOnPage url="{{StorefrontProductPage.url($$product.name$$)}}" stepKey="goToSimpleProductPage"/>
4040
<waitForPageLoad stepKey="waitForSimpleProductPage"/>
41-
4241
<!--'Add to compare' link is not available-->
42+
<comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/>
4343
<dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/>
44-
45-
<!--Turn on 'out of stock' config-->
46-
<actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/>
47-
48-
<!--Clear cache-->
49-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCache" />
44+
<!--Turn on 'out on stock' config-->
45+
<comment userInput="Turn on 'out of stock' config" stepKey="onOutOfStockConfig"/>
46+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 1" stepKey="displayOutOfStockYes"/>
47+
<!--Clear cache and reindex-->
48+
<comment userInput="Clear cache and reindex" stepKey="cleanCache"/>
5049
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
51-
50+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
5251
<!--Open product page-->
53-
<amOnPage url="$$product.name$$.html" stepKey="goToSimpleProductPage2"/>
52+
<comment userInput="Open product page" stepKey="openProductPage"/>
53+
<amOnPage url="{{StorefrontProductPage.url($$product.name$$)}}" stepKey="goToSimpleProductPage2"/>
5454
<waitForPageLoad stepKey="waitForSimpleProductPage2"/>
55-
5655
<!--Click on 'Add to Compare' link-->
56+
<comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/>
5757
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/>
58-
58+
<waitForPageLoad stepKey="waitForProdAddToCmpList"/>
59+
<!--Assert success message-->
60+
<comment userInput="Assert success message" stepKey="assertSuccessMsg"/>
61+
<grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage"/>
62+
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage"/>
5963
<!--See product in the comparison list-->
64+
<comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/>
6065
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
66+
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/>
6167
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList"/>
68+
<!--Go to Category page and delete product from comparison list-->
69+
<comment userInput="Go to Category page and delete prduct from comparison list" stepKey="deletProdFromCmpList"/>
70+
<amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="onCategoryPage"/>
71+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
72+
<click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/>
73+
<waitForPageLoad time="30" stepKey="waitForConfirmPageLoad"/>
74+
<click selector="{{AdminDeleteRoleSection.confirm}}" stepKey="confirmProdDelate"/>
75+
<waitForPageLoad time="30" stepKey="waitForConfirmLoad"/>
76+
<!--Add product to compare list from Category page-->
77+
<comment userInput="Add product to compare list fom Category page" stepKey="addToCmpFromCategPage"/>
78+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/>
79+
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/>
80+
<waitForPageLoad stepKey="waitProdAddingToCmpList"/>
81+
<!--Assert success message-->
82+
<comment userInput="Assert success message" stepKey="assertSuccessMsg2"/>
83+
<grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage2"/>
84+
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage2"/>
85+
<!--Check that product displays on add to compare widget-->
86+
<comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/>
87+
<seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/>
88+
<!--See product in the compare page-->
89+
<comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/>
90+
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage2"/>
91+
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad2"/>
92+
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList2"/>
6293
</test>
6394
</tests>

0 commit comments

Comments
 (0)