|
| 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 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 19 | + <createData entity="_defaultProduct" stepKey="productAssignedToCustomWebsite"> |
| 20 | + <requiredEntity createDataKey="createCategory"/> |
| 21 | + </createData> |
| 22 | + <createData entity="SimpleProduct" stepKey="productAssignedToMainWebsite"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + |
| 26 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 27 | + <!--Create new website --> |
| 28 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> |
| 29 | + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> |
| 30 | + <argument name="websiteCode" value="{{customWebsite.code}}"/> |
| 31 | + </actionGroup> |
| 32 | + <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> |
| 33 | + <magentoCLI command="cache:flush" stepKey="flushCacheAfterEnableWebUrlOptions"/> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 37 | + <deleteData createDataKey="productAssignedToCustomWebsite" stepKey="deleteProductAssignedToCustomWebsite"/> |
| 38 | + <deleteData createDataKey="productAssignedToMainWebsite" stepKey="deleteProductAssignedToMainWebsite"/> |
| 39 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> |
| 40 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 41 | + </actionGroup> |
| 42 | + <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> |
| 43 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 44 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 45 | + <actionGroup ref="logout" stepKey="logout"/> |
| 46 | + </after> |
| 47 | + |
| 48 | + <!--Assign Custom Website to Simple Product --> |
| 49 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> |
| 50 | + <waitForPageLoad stepKey="waitForCatalogProductGrid"/> |
| 51 | + |
| 52 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> |
| 53 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="assignCustomWebsiteToProduct"> |
| 54 | + <argument name="product" value="$$productAssignedToCustomWebsite$$"/> |
| 55 | + </actionGroup> |
| 56 | + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> |
| 57 | + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> |
| 58 | + <waitForPageLoad stepKey="waitForPageOpened"/> |
| 59 | + <uncheckOption selector="{{ProductInWebsitesSection.website(_defaultWebsite.name)}}" stepKey="deselectMainWebsite"/> |
| 60 | + <checkOption selector="{{ProductInWebsitesSection.website(customWebsite.name)}}" stepKey="selectWebsite"/> |
| 61 | + |
| 62 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> |
| 63 | + <waitForLoadingMaskToDisappear stepKey="waitForProductPageToSaveAgain"/> |
| 64 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageAgain"/> |
| 65 | + |
| 66 | + <!--Navigate To Product Grid To Check Website Sorting--> |
| 67 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGridToSortByWebsite"/> |
| 68 | + <waitForPageLoad stepKey="waitForCatalogProductGridLoaded"/> |
| 69 | + |
| 70 | + <!--Sorting works (By Websites) ASC--> |
| 71 | + <click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortAsc"/> |
| 72 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Main Website" stepKey="checkIfProduct1WebsitesAsc"/> |
| 73 | + |
| 74 | + <!--Sorting works (By Websites) DESC--> |
| 75 | + <click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortDesc"/> |
| 76 | + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{{customWebsite.name}}" stepKey="checkIfProduct1WebsitesDesc"/> |
| 77 | + </test> |
| 78 | +</tests> |
0 commit comments