|
| 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="Add out of stock product to compare list"/> |
| 15 | + <description value="Add out of stock product to compare list"/> |
| 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 | + <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"> |
| 27 | + <requiredEntity createDataKey="category"/> |
| 28 | + </createData> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <magentoCLI command="config:set cataloginventory/options/show_out_of_stock 0" stepKey="displayOutOfStockNo2"/> |
| 32 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 33 | + <deleteData createDataKey="product" stepKey="deleteProduct"/> |
| 34 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 35 | + <actionGroup ref="logout" stepKey="logout"/> |
| 36 | + </after> |
| 37 | + <!--Open product page--> |
| 38 | + <comment userInput="Open product page" stepKey="openProdPage"/> |
| 39 | + <amOnPage url="{{StorefrontProductPage.url($$product.name$$)}}" stepKey="goToSimpleProductPage"/> |
| 40 | + <waitForPageLoad stepKey="waitForSimpleProductPage"/> |
| 41 | + <!--'Add to compare' link is not available--> |
| 42 | + <comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/> |
| 43 | + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/> |
| 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"/> |
| 49 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 50 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 51 | + <!--Open product page--> |
| 52 | + <comment userInput="Open product page" stepKey="openProductPage"/> |
| 53 | + <amOnPage url="{{StorefrontProductPage.url($$product.name$$)}}" stepKey="goToSimpleProductPage2"/> |
| 54 | + <waitForPageLoad stepKey="waitForSimpleProductPage2"/> |
| 55 | + <!--Click on 'Add to Compare' link--> |
| 56 | + <comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/> |
| 57 | + <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/> |
| 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"/> |
| 63 | + <!--See product in the comparison list--> |
| 64 | + <comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/> |
| 65 | + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> |
| 66 | + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> |
| 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"/> |
| 93 | + </test> |
| 94 | +</tests> |
0 commit comments