forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-4405: Sorting by Websites not working in product grid in backo…
…ffice magento#20511 magento#20512
- Loading branch information
Showing
2 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminSortingByWebsitesTest"> | ||
<annotations> | ||
<stories value="View sorting by websites"/> | ||
<title value="Sorting by websites in Admin"/> | ||
<description value="Sorting products by websites in Admin"/> | ||
</annotations> | ||
<before> | ||
<createData entity="_defaultCategory" stepKey="createCategory"/> | ||
<createData entity="_defaultProduct" stepKey="productAssignedToCustomWebsite"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
<createData entity="SimpleProduct" stepKey="productAssignedToMainWebsite"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
<!--Create new website --> | ||
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> | ||
<argument name="newWebsiteName" value="{{customWebsite.name}}"/> | ||
<argument name="websiteCode" value="{{customWebsite.code}}"/> | ||
</actionGroup> | ||
<actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCacheAfterEnableWebUrlOptions"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="productAssignedToCustomWebsite" stepKey="deleteProductAssignedToCustomWebsite"/> | ||
<deleteData createDataKey="productAssignedToMainWebsite" stepKey="deleteProductAssignedToMainWebsite"/> | ||
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> | ||
<argument name="websiteName" value="{{customWebsite.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> | ||
<magentoCLI command="indexer:reindex" stepKey="reindex"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!--Assign Custom Website to Simple Product --> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> | ||
<waitForPageLoad stepKey="waitForCatalogProductGrid"/> | ||
|
||
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> | ||
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="assignCustomWebsiteToProduct"> | ||
<argument name="product" value="$$productAssignedToCustomWebsite$$"/> | ||
</actionGroup> | ||
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> | ||
<conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> | ||
<waitForPageLoad stepKey="waitForPageOpened"/> | ||
<uncheckOption selector="{{ProductInWebsitesSection.website(_defaultWebsite.name)}}" stepKey="deselectMainWebsite"/> | ||
<checkOption selector="{{ProductInWebsitesSection.website(customWebsite.name)}}" stepKey="selectWebsite"/> | ||
|
||
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForProductPageToSaveAgain"/> | ||
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageAgain"/> | ||
|
||
<!--Navigate To Product Grid To Check Website Sorting--> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGridToSortByWebsite"/> | ||
<waitForPageLoad stepKey="waitForCatalogProductGridLoaded"/> | ||
|
||
<!--Sorting works (By Websites) ASC--> | ||
<click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortAsc"/> | ||
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Main Website" stepKey="checkIfProduct1WebsitesAsc"/> | ||
|
||
<!--Sorting works (By Websites) DESC--> | ||
<click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortDesc"/> | ||
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{{customWebsite.name}}" stepKey="checkIfProduct1WebsitesDesc"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters