-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting by Websites not working in product grid in backoffice #20511 #20512
Changes from 7 commits
0dfe0f0
e61b399
fa49579
8170bd7
f4d1442
93da772
5362c5a
f57e5e8
a6f266d
a32d27b
c76d248
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?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> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
<!--Create new website --> | ||
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> | ||
<argument name="newWebsiteName" value="Second Website"/> | ||
<argument name="websiteCode" value="second_website"/> | ||
</actionGroup> | ||
</before> | ||
<after> | ||
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> | ||
<argument name="websiteName" value="Second Website"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once you will use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
</actionGroup> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> | ||
<!--Create a Simple Product --> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> | ||
<waitForPageLoad stepKey="waitForCatalogProductGrid"/> | ||
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> | ||
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> | ||
<fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> | ||
<fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> | ||
<fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> | ||
<fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> | ||
|
||
<!--Save the product --> | ||
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitProductPageSave"/> | ||
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeProductSavedMessage"/> | ||
|
||
<!-- Add this product to second website --> | ||
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsitesSection1"/> | ||
<click selector="{{ProductInWebsitesSection.website('Second Website')}}" stepKey="selectSecondWebsite"/> | ||
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForProductPagetoSaveAgain"/> | ||
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageAgain"/> | ||
|
||
<!--Create a Simple Product 2 --> | ||
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="openProductCatalogPage"/> | ||
<waitForPageLoad stepKey="waitForProductCatalogPage"/> | ||
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/> | ||
<waitForPageLoad stepKey="waitForProductToggleToSelectSimpleProduct"/> | ||
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickSimpleProductFromDropDownList"/> | ||
|
||
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.name}}" stepKey="fillSimpleProductName"/> | ||
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.price}}" stepKey="fillSimpleProductPrice"/> | ||
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.weight}}" stepKey="fillSimpleProductWeight"/> | ||
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.quantity}}" stepKey="fillSimpleProductQuantity"/> | ||
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSaveButton2"/> | ||
<waitForPageLoad stepKey="waitForSimpleProductToSave"/> | ||
<!-- Verify customer see success message --> | ||
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> | ||
|
||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid2"/> | ||
<waitForPageLoad stepKey="waitForCatalogProductGrid2"/> | ||
|
||
<!--Sorting works (By Websites) ASC--> | ||
<actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultSortingWebsites"/> | ||
<click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortAsc"/> | ||
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Main Website" stepKey="checkIfProduct1WebsitesAsc"/> | ||
<see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Second Website" stepKey="checkIfProduct2WebsitesAsc"/> | ||
|
||
<!--Sorting works (By Websites) DESC--> | ||
<click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortDesc"/> | ||
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Second Website" stepKey="checkIfProduct1WebsitesDesc"/> | ||
<see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Main Website" stepKey="checkIfProduct2WebsitesDesc"/> | ||
</test> | ||
</tests> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend to use data entity
customWebsite
.It will create unique WebSite Name and WebSite code.
Arguments will look like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done