|
7 | 7 | -->
|
8 | 8 |
|
9 | 9 | <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"> |
11 | 11 | <test name="AddOutOfStockProductToCompareListTest">
|
12 | 12 | <annotations>
|
13 | 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"/> |
| 14 | + <title value="Add out of stock product to compare list"/> |
| 15 | + <description value="Add out of stock product to compare list"/> |
16 | 16 | <severity value="MAJOR"/>
|
17 | 17 | <testCaseId value="MAGETWO-98644"/>
|
18 | 18 | <useCaseId value="MAGETWO-98522"/>
|
19 | 19 | <group value="Catalog"/>
|
20 | 20 | </annotations>
|
21 | 21 | <before>
|
22 | 22 | <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"> |
25 | 27 | <requiredEntity createDataKey="category"/>
|
26 | 28 | </createData>
|
27 | 29 | </before>
|
28 | 30 | <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"/> |
30 | 33 | <deleteData createDataKey="product" stepKey="deleteProduct"/>
|
31 | 34 | <deleteData createDataKey="category" stepKey="deleteCategory"/>
|
32 |
| - <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> |
| 35 | + <actionGroup ref="logout" stepKey="logout"/> |
33 | 36 | </after>
|
34 |
| - |
35 |
| - <!--Check 'out of stock' is turned off by default--> |
36 |
| - <actionGroup ref="noDisplayOutOfStockProduct" stepKey="noDisplayOutOfStockProduct"/> |
37 |
| - |
38 | 37 | <!--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"/> |
40 | 40 | <waitForPageLoad stepKey="waitForSimpleProductPage"/>
|
41 |
| - |
42 | 41 | <!--'Add to compare' link is not available-->
|
| 42 | + <comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/> |
43 | 43 | <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"/> |
50 | 49 | <magentoCLI command="indexer:reindex" stepKey="reindex"/>
|
51 |
| - |
| 50 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
52 | 51 | <!--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"/> |
54 | 54 | <waitForPageLoad stepKey="waitForSimpleProductPage2"/>
|
55 |
| - |
56 | 55 | <!--Click on 'Add to Compare' link-->
|
| 56 | + <comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/> |
57 | 57 | <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"/> |
59 | 63 | <!--See product in the comparison list-->
|
| 64 | + <comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/> |
60 | 65 | <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
|
| 66 | + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> |
61 | 67 | <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"/> |
62 | 93 | </test>
|
63 | 94 | </tests>
|
0 commit comments