|
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 | + <createData entity="DisableDisplayOutOfStock" 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>
|
| 31 | + <actionGroup ref="setAsDefaultOutOfStockProduct" stepKey="setAsDefaultOutOfStockProduct"/> |
| 32 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
29 | 33 | <deleteData createDataKey="product" stepKey="deleteProduct"/>
|
30 | 34 | <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"/> |
| 35 | + <actionGroup ref="logout" stepKey="logout"/> |
36 | 36 |
|
| 37 | + </after> |
37 | 38 | <!--Open product page-->
|
38 |
| - <amOnPage url="$$product.name$$.html" stepKey="goToSimpleProductPage"/> |
| 39 | + <comment userInput="Open product page" stepKey="openProdPage"/> |
| 40 | + <amOnPage url="{{StorefrontProductPage.url($$product.name$$)}}" stepKey="goToSimpleProductPage"/> |
39 | 41 | <waitForPageLoad stepKey="waitForSimpleProductPage"/>
|
40 |
| - |
41 | 42 | <!--'Add to compare' link is not available-->
|
| 43 | + <comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/> |
42 | 44 | <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 |
| - |
| 45 | + <!--Turn on 'out on stock' config--> |
| 46 | + <comment userInput="Turn on 'out of stock' config" stepKey="onOutOfStockConfig"/> |
| 47 | + <createData entity="EnableDisplayOutOfStock" stepKey="displayOutOfStockYes"/> |
| 48 | + <!--Clear cache and reindex--> |
| 49 | + <comment userInput="Clear cache and reindex" stepKey="cleanCache"/> |
| 50 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 51 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
50 | 52 | <!--Open product page-->
|
51 |
| - <amOnPage url="$$product.name$$.html" stepKey="goToSimpleProductPage2"/> |
| 53 | + <comment userInput="Open product page" stepKey="openProductPage"/> |
| 54 | + <amOnPage url="{{StorefrontProductPage.url($$product.name$$)}}" stepKey="goToSimpleProductPage2"/> |
52 | 55 | <waitForPageLoad stepKey="waitForSimpleProductPage2"/>
|
53 |
| - |
54 | 56 | <!--Click on 'Add to Compare' link-->
|
| 57 | + <comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/> |
55 | 58 | <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/>
|
56 |
| - |
| 59 | + <waitForPageLoad stepKey="waitForProdAddToCmpList"/> |
| 60 | + <!--Assert success message--> |
| 61 | + <comment userInput="Assert success message" stepKey="assertSuccessMsg"/> |
| 62 | + <grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage"/> |
| 63 | + <assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage"/> |
57 | 64 | <!--See product in the comparison list-->
|
| 65 | + <comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/> |
58 | 66 | <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
|
| 67 | + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> |
59 | 68 | <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList"/>
|
| 69 | + <!--Add product to compare list fom Category page--> |
| 70 | + <comment userInput="Add product to compare list fom Category page" stepKey="addToCmpFromCategPage"/> |
| 71 | + <amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="onCategoryPage"/> |
| 72 | + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> |
| 73 | + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/> |
| 74 | + <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> |
| 75 | + <waitForPageLoad stepKey="waitProdAddingToCmpList"/> |
| 76 | + <!--Assert success message--> |
| 77 | + <comment userInput="Assert success message" stepKey="assertSuccessMsg2"/> |
| 78 | + <grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage2"/> |
| 79 | + <assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage2"/> |
| 80 | + <!--Check that product displays on add to compare widget--> |
| 81 | + <comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/> |
| 82 | + <seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/> |
| 83 | + <!--See product in the compare page--> |
| 84 | + <comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/> |
| 85 | + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage2"/> |
| 86 | + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad2"/> |
| 87 | + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList2"/> |
60 | 88 | </test>
|
61 | 89 | </tests>
|
0 commit comments