|
| 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="AdminSortingByWebsitesTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="View sorting by websites"/> |
| 14 | + <title value="Sorting by websites in Admin"/> |
| 15 | + <description value="Sorting products by websites in Admin"/> |
| 16 | + </annotations> |
| 17 | + <before> |
| 18 | + <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> |
| 19 | + |
| 20 | + <!--Create Website --> |
| 21 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> |
| 22 | + <argument name="newWebsiteName" value="Second Website"/> |
| 23 | + <argument name="websiteCode" value="second_website"/> |
| 24 | + </actionGroup> |
| 25 | + |
| 26 | + <!--Create Store --> |
| 27 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> |
| 28 | + <argument name="website" value="Second Website"/> |
| 29 | + <argument name="storeGroupName" value="Second Store"/> |
| 30 | + <argument name="storeGroupCode" value="second_store"/> |
| 31 | + </actionGroup> |
| 32 | + |
| 33 | + <!--Create Store view --> |
| 34 | + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> |
| 35 | + <waitForPageLoad stepKey="waitForSystemStorePage"/> |
| 36 | + <click selector="{{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey="createStoreViewButton"/> |
| 37 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 38 | + <waitForElementVisible selector="//legend[contains(., 'Store View Information')]" stepKey="waitForNewStorePageToOpen"/> |
| 39 | + <selectOption userInput="Second Store" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> |
| 40 | + <fillField userInput="Second Store View" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> |
| 41 | + <fillField userInput="second_store_view" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> |
| 42 | + <selectOption selector="{{AdminNewStoreSection.statusDropdown}}" userInput="1" stepKey="enableStoreViewStatus"/> |
| 43 | + <click selector="{{AdminNewStoreViewActionsSection.saveButton}}" stepKey="clickSaveStoreView" /> |
| 44 | + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal" /> |
| 45 | + <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarning" /> |
| 46 | + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="dismissModal" /> |
| 47 | + <waitForPageLoad stepKey="waitForPageLoad2" time="180" /> |
| 48 | + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" time="150" stepKey="waitForPageReolad"/> |
| 49 | + <see userInput="You saved the store view." stepKey="seeSavedMessage" /> |
| 50 | + |
| 51 | + <!--Create a Simple Product 1 --> |
| 52 | + <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1"> |
| 53 | + <argument name="product" value="simpleProductForMassUpdate"/> |
| 54 | + <argument name="website" value="Second Website"/> |
| 55 | + </actionGroup> |
| 56 | + |
| 57 | + <!--Create a Simple Product 2 --> |
| 58 | + <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2"> |
| 59 | + <argument name="product" value="simpleProductForMassUpdate2"/> |
| 60 | + <argument name="website" value="Second Website"/> |
| 61 | + </actionGroup> |
| 62 | + </before> |
| 63 | + <after> |
| 64 | + <!--Delete website --> |
| 65 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite"> |
| 66 | + <argument name="websiteName" value="Second Website"/> |
| 67 | + </actionGroup> |
| 68 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 69 | + |
| 70 | + <!--Delete Products --> |
| 71 | + <actionGroup ref="DeleteProductActionGroup" stepKey="deleteProduct1"> |
| 72 | + <argument name="productName" value="simpleProductForMassUpdate.name"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="DeleteProductActionGroup" stepKey="deleteProduct2"> |
| 75 | + <argument name="productName" value="simpleProductForMassUpdate2.name"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="logout" stepKey="amOnLogoutPage"/> |
| 78 | + </after> |
| 79 | + |
| 80 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> |
| 81 | + <waitForPageLoad stepKey="waitForCatalogProductGrid"/> |
| 82 | + |
| 83 | + <!--Sort Ascending--> |
| 84 | + <click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortAsc"/> |
| 85 | + <grabTextFrom selector="{{AdminProductGridSection.productGridCell('Ukraine', 'Country of Manufacture')}}" stepKey="getFirstWebsitesSortAsc"/> |
| 86 | + <grabTextFrom selector="{{AdminProductGridSection.productGridCell('Cameroon', 'Country of Manufacture')}}" stepKey="getSecondWebsitesSortAsc"/> |
| 87 | + <assertLessThanOrEqual expected="$getSecondPriceSortAsc" actual="$getFirstPriceSortAsc" stepKey="checkPriceAscSortCorrect"/> |
| 88 | + <!--Sort Descending--> |
| 89 | + <click selector="{{AdminProductGridSection.columnHeader('Country of Manufacture')}}" stepKey="clickWebsitesHeaderToSortDesc"/> |
| 90 | + <grabTextFrom selector="{{AdminProductGridSection.productGridCell('Ukraine', 'Country of Manufacture')}}" stepKey="getFirstWebsitesSortDesc"/> |
| 91 | + <grabTextFrom selector="{{AdminProductGridSection.productGridCell('Cameroon', 'Country of Manufacture')}}" stepKey="getSecondWebsitesSortDesc"/> |
| 92 | + <assertGreaterThanOrEqual expected="$getSecondWebsitesSortDesc" actual="$getFirstWebsitesSortDesc" stepKey="checkWebsitesDescSortCorrect"/> |
| 93 | + </test> |
| 94 | +</tests> |
0 commit comments