Skip to content

Commit 977f796

Browse files
Merge branch 'ACQE-4405-2' into ACQE-6651_mainline_PR_deployment
2 parents 3e65afa + 8953582 commit 977f796

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryBasicFieldSection/AdminCategoryBasicFieldSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@
3434
<element name="destinationCategory" type="text" selector="//li[contains(@class, 'jstree-node')]//a[contains(text(),'Default Category')]"/>
3535
<element name="grabPopUpText" type="input" selector="//div[@class='modal-inner-wrap']//div[@data-id='information-dialog-category']//div[text()='This operation can take a long time']"/>
3636
<element name="acceptPopUp" type="input" selector="//div[@class='modal-inner-wrap']//button[@class='action-primary']/span[text()='Ok']"/>
37+
<element name="saveCategory" type="button" selector="#save" timeout="30"/>
38+
<element name="expandCollapseProductsInCategorySection" type="text" selector="//div[@data-state-collapsible='{{status}}']//strong//span[text()='{{section}}']" parameterized="true"/>
39+
<element name="productPositionInCategory" type="input" selector="//td[contains(@class,'col-name') and contains(text(),'{{productName}}')]/following-sibling::td//input[@name='position']" parameterized="true"/>
40+
<element name="btnMoveProductToFirstPosition" type="button" selector="//td[contains(@class,'col-name') and contains(text(),'{{productName}}')]/following-sibling::td//a[@class='move-top icon-backward']" parameterized="true" timeout="30"/>
41+
<element name="btnMoveProductToLastPosition" type="button" selector="//td[contains(@class,'col-name') and contains(text(),'{{productName}}')]/following-sibling::td//a[@class='move-bottom icon-forward']" parameterized="true" timeout="30"/>
3742
</section>
3843
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<element name="outOfStockProductCategoryPage" type="text" selector="//div[@class='stock unavailable']//span[text()='Out of stock']"/>
4747
<element name="ListedProductAttributes" type="block" selector="//div[@aria-label='{{vs_attribute}}']//div[@aria-label='{{attribute_name}}']" parameterized="true"/>
4848
<element name="quickOrderLink" type="text" selector="//div[@class='panel header']//a[text()='Quick Order']" />
49+
<element name="productListInCategoryStorefront" type="block" selector="//div[@class='products wrapper grid products-grid']//li[@class='item product product-item'][{{index}}]//img[@alt='{{product_name}}']" parameterized="true"/>
4950
<element name="productNameWithPriceOrLabel" type="text" selector="//div[@class='product details product-item-details']//a[contains(text(),'{{ProductName}}')]//parent::strong/following-sibling::div//span[contains(text(),'{{PriceLabelOrPrice}}')]" parameterized="true"/>
5051
<element name="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
5152
<element name="productInOrderDisplay" type="text" selector="//li[@class='item product product-item'][{{index}}]//a[@class='product-item-link' and contains(text(),'{{product_name}}')]" parameterized="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminDynamicSortAssignProductsToFirstAndLastPositionActionGroup">
11+
<annotations>
12+
<description>Admin reassigns the display order of the products (in category backend) for storefront for EE and B2B</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="product1" type="string"/>
16+
<argument name="product3" type="string"/>
17+
</arguments>
18+
<!-- Admin Scroll to the Products In Category tab and expand the tab if closed -->
19+
<scrollTo selector="{{AdminCategoryBasicFieldSection.expandCollapseProductsInCategorySection('closed','Products in Category')}}" stepKey="adminScrollToProductsInCategorySectionForIndexing"/>
20+
<conditionalClick selector="{{AdminCategoryBasicFieldSection.expandCollapseProductsInCategorySection('closed','Products in Category')}}" dependentSelector="{{AdminCategoryBasicFieldSection.expandCollapseProductsInCategorySection('closed','Products in Category')}}" visible="true" stepKey="adminExpandsProductsInCategorySectionForIndexing"/>
21+
<!-- Admin resets the positions for the products -->
22+
<waitForElementVisible selector="{{AdminCategoryBasicFieldSection.productPositionInCategory('product1')}}" stepKey="adminWaitsForPositionFieldToPopulate"/>
23+
<scrollTo selector="{{AdminCategoryBasicFieldSection.btnMoveProductToFirstPosition('product1')}}" stepKey="scrollToTheListedProduct"/>
24+
<click selector="{{AdminCategoryBasicFieldSection.btnMoveProductToFirstPosition('product1')}}" stepKey="adminMovesProductToFirstIndex"/>
25+
<click selector="{{AdminCategoryBasicFieldSection.btnMoveProductToLastPosition('product3')}}" stepKey="adminMovesProductToLastIndex"/>
26+
<!-- Admin Saves the category and validate the success message -->
27+
<click selector="{{AdminCategoryBasicFieldSection.saveCategory}}" stepKey="adminSavesTheCategory"/>
28+
<waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the category." stepKey="adminVerifiesSuccessMessagePostSavingTheCategory"/>
29+
</actionGroup>
30+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertProductsInCategoryPageAsPerSetPositionInBackendActionGroup">
12+
<annotations>
13+
<description>Asserts the position of the Product in the Storefront Category page as per the set position in the backend.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="string"/>
17+
<argument name="position" type="string"/>
18+
</arguments>
19+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productListInCategoryStorefront(position,'product')}}" stepKey="guestAssertsProduct1PositionOnCategoryPage"/>
20+
</actionGroup>
21+
</actionGroups>

0 commit comments

Comments
 (0)