|
| 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="AdminMassUpdateProductStatusStoreViewScopeTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Mass update product status"/> |
| 15 | + <title value="Admin should be able to mass update product statuses in store view scope"/> |
| 16 | + <description value="Admin should be able to mass update product statuses in store view scope"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="MAGETWO-59361"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + <group value="Product Attributes"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + |
| 25 | + <!--Create Website --> |
| 26 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> |
| 27 | + <argument name="newWebsiteName" value="Second Website"/> |
| 28 | + <argument name="websiteCode" value="second_website"/> |
| 29 | + </actionGroup> |
| 30 | + |
| 31 | + <!--Create Store --> |
| 32 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> |
| 33 | + <argument name="website" value="Second Website"/> |
| 34 | + <argument name="storeGroupName" value="Second Store"/> |
| 35 | + <argument name="storeGroupCode" value="second_store"/> |
| 36 | + </actionGroup> |
| 37 | + |
| 38 | + <!--Create Store view --> |
| 39 | + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> |
| 40 | + <waitForPageLoad stepKey="waitForSystemStorePage"/> |
| 41 | + <click selector="{{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey="createStoreViewButton"/> |
| 42 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 43 | + <waitForElementVisible selector="//legend[contains(., 'Store View Information')]" stepKey="waitForNewStorePageToOpen"/> |
| 44 | + <selectOption userInput="Second Store" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> |
| 45 | + <fillField userInput="Second Store View" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> |
| 46 | + <fillField userInput="second_store_view" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> |
| 47 | + <selectOption selector="{{AdminNewStoreSection.statusDropdown}}" userInput="1" stepKey="enableStoreViewStatus"/> |
| 48 | + <click selector="{{AdminNewStoreViewActionsSection.saveButton}}" stepKey="clickSaveStoreView" /> |
| 49 | + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal" /> |
| 50 | + <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarning" /> |
| 51 | + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="dismissModal" /> |
| 52 | + <waitForPageLoad stepKey="waitForPageLoad2" time="180" /> |
| 53 | + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" time="150" stepKey="waitForPageReolad"/> |
| 54 | + <see userInput="You saved the store view." stepKey="seeSavedMessage" /> |
| 55 | + |
| 56 | + <!--Create a Simple Product 1 --> |
| 57 | + <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1"> |
| 58 | + <argument name="product" value="simpleProductForMassUpdate"/> |
| 59 | + <argument name="website" value="Second Website"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <!--Create a Simple Product 2 --> |
| 63 | + <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2"> |
| 64 | + <argument name="product" value="simpleProductForMassUpdate2"/> |
| 65 | + <argument name="website" value="Second Website"/> |
| 66 | + </actionGroup> |
| 67 | + </before> |
| 68 | + <after> |
| 69 | + <!--Delete website --> |
| 70 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite"> |
| 71 | + <argument name="websiteName" value="Second Website"/> |
| 72 | + </actionGroup> |
| 73 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 74 | + |
| 75 | + <!--Delete Products --> |
| 76 | + <actionGroup ref="DeleteProductActionGroup" stepKey="deleteProduct1"> |
| 77 | + <argument name="productName" value="simpleProductForMassUpdate.name"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="DeleteProductActionGroup" stepKey="deleteProduct2"> |
| 80 | + <argument name="productName" value="simpleProductForMassUpdate2.name"/> |
| 81 | + </actionGroup> |
| 82 | + <actionGroup ref="logout" stepKey="amOnLogoutPage"/> |
| 83 | + </after> |
| 84 | + |
| 85 | + <!-- Search and select products --> |
| 86 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 87 | + <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> |
| 88 | + <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> |
| 89 | + <argument name="keyword" value="{{simpleProductForMassUpdate.keyword}}"/> |
| 90 | + </actionGroup> |
| 91 | + <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> |
| 92 | + |
| 93 | + <!-- Filter to Second Store View --> |
| 94 | + <actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterStoreView" > |
| 95 | + <argument name="customStore" value="'Second Store View'" /> |
| 96 | + </actionGroup> |
| 97 | + |
| 98 | + <!-- Select Product 2 --> |
| 99 | + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> |
| 100 | + |
| 101 | + <!-- Mass update attributes --> |
| 102 | + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/> |
| 103 | + <click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickOption"/> |
| 104 | + <click selector="{{AdminProductGridSection.bulkActionOption('Disable')}}" stepKey="clickDisabled"/> |
| 105 | + <waitForPageLoad stepKey="waitForBulkUpdatePage"/> |
| 106 | + |
| 107 | + <!-- Verify Product Statuses --> |
| 108 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Enabled" stepKey="checkIfProduct1IsEnabled"/> |
| 109 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Disabled" stepKey="checkIfProduct2IsDisabled"/> |
| 110 | + |
| 111 | + <!-- Filter to Default Store View --> |
| 112 | + <actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterDefaultStoreView"> |
| 113 | + <argument name="customStore" value="'Default'" /> |
| 114 | + </actionGroup> |
| 115 | + |
| 116 | + <!-- Verify Product Statuses --> |
| 117 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Enabled" stepKey="checkIfDefaultViewProduct1IsEnabled"/> |
| 118 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Enabled" stepKey="checkIfDefaultViewProduct2IsEnabled"/> |
| 119 | + |
| 120 | + <!-- Assert on storefront default view --> |
| 121 | + <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/> |
| 122 | + <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault"> |
| 123 | + <argument name="name" value="{{simpleProductForMassUpdate.keyword}}"/> |
| 124 | + <argument name="description" value=""/> |
| 125 | + </actionGroup> |
| 126 | + <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/> |
| 127 | + <see userInput="2 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/> |
| 128 | + |
| 129 | + <!-- Enable the product in Default store view --> |
| 130 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex2"/> |
| 131 | + <waitForPageLoad stepKey="waitForProductIndexPageLoad2"/> |
| 132 | + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckboxDefaultStoreView"/> |
| 133 | + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckboxDefaultStoreView2"/> |
| 134 | + |
| 135 | + <!-- Mass update attributes --> |
| 136 | + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdownDefaultStoreView"/> |
| 137 | + <click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickOptionDefaultStoreView"/> |
| 138 | + <click selector="{{AdminProductGridSection.bulkActionOption('Disable')}}" stepKey="clickDisabledDefaultStoreView"/> |
| 139 | + <waitForPageLoad stepKey="waitForBulkUpdatePageDefaultStoreView"/> |
| 140 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Disabled" stepKey="checkIfProduct2IsDisabledDefaultStoreView"/> |
| 141 | + |
| 142 | + <!-- Assert on storefront default view --> |
| 143 | + <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault2"/> |
| 144 | + <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault2"> |
| 145 | + <argument name="name" value="{{simpleProductForMassUpdate.name}}"/> |
| 146 | + <argument name="description" value=""/> |
| 147 | + </actionGroup> |
| 148 | + <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault2"/> |
| 149 | + <see userInput="We can't find any items matching these search criteria." selector="{{StorefrontCatalogSearchAdvancedResultMainSection.message}}" stepKey="seeInDefault2"/> |
| 150 | + </test> |
| 151 | +</tests> |
0 commit comments