Skip to content

Commit 6a11ca4

Browse files
committed
Merge branch '2.4-develop' of https://github.com/adobe-commerce-tier-4/magento2ce into PR-03-12-2024-anna
2 parents 32f8948 + b072f7b commit 6a11ca4

19 files changed

+624
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminUpdateAttributeUsedForSortingInProductListingActionGroup">
12+
<annotations>
13+
<description>Admin selects the values for "Use For Sorting in Product Listing" for created attribute </description>
14+
</annotations>
15+
<arguments>
16+
<argument name="usedForSortingInProductListing" type="string" defaultValue="Yes"/>
17+
</arguments>
18+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="navigateToStorefrontPropertiesTab"/>
19+
<waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitForStorefrontPropertiesTabLoad"/>
20+
<selectOption selector="{{StorefrontPropertiesSection.usedForSortingInProductListing}}" userInput="{{usedForSortingInProductListing}}" stepKey="setValueForSortingInProductListing"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AssertProductSortingBasedOnAttributesInStorefrontCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to the Storefront page. Validates the sorting of products based on the attributes.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product1" defaultValue="product"/>
17+
<argument name="product2" defaultValue="product"/>
18+
<argument name="sortBy" type="string"/>
19+
</arguments>
20+
<selectOption userInput="{{sortBy}}" selector="{{StorefrontCategoryTopToolbarSection.sortByDropdown}}" stepKey="selectSortBy"/>
21+
<waitForPageLoad stepKey="waitForPageLoadPostSelectingSortBy"/>
22+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productInOrderDisplay('1',product1.name)}}" stepKey="assertsTheProductAtIndex1"/>
23+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productInOrderDisplay('2',product2.name)}}" stepKey="assertsTheProductAtIndex2"/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

+23
Original file line numberDiff line numberDiff line change
@@ -443,4 +443,27 @@
443443
<data key="attribute_code">attribute</data>
444444
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelForExportImport</requiredEntity>
445445
</entity>
446+
<!-- Product attributes for sorting in product listing as No -->
447+
<entity name="textAttributeWithNoProductSortListing" extends="newProductAttribute" type="ProductAttribute">
448+
<data key="used_for_sort_by">false</data>
449+
</entity>
450+
<entity name="dateAttributeWithNoProductSortListing" extends="productAttributeWysiwyg" type="ProductAttribute">
451+
<data key="frontend_input">date</data>
452+
<data key="used_for_sort_by">false</data>
453+
</entity>
454+
<entity name="yesNoAttributeWithNoProductSortListing" extends="productYesNoAttribute" type="ProductAttribute">
455+
<data key="used_for_sort_by">false</data>
456+
</entity>
457+
<entity name="dropdownAttributeWithNoProductSortListing" extends="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
458+
<data key="used_for_sort_by">false</data>
459+
</entity>
460+
<entity name="multiSelectAttributeWithNoProductSortListing" extends="productDropDownAttribute" type="ProductAttribute">
461+
<data key="frontend_input">multiselect</data>
462+
<data key="used_for_sort_by">false</data>
463+
</entity>
464+
<entity name="priceAttributeWithNoProductSortListing" extends="newProductAttribute" type="ProductAttribute">
465+
<data key="frontend_input">price</data>
466+
<data key="used_for_sort_by">false</data>
467+
</entity>
446468
</entities>
469+

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/StorefrontPropertiesSection.xml

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="useForPromoRuleConditions" type="select" selector="#is_used_for_promo_rules"/>
1515
<element name="StorefrontPropertiesSectionToggle" type="button" selector="#front_fieldset-wrapper"/>
1616
<element name="visibleOnCatalogPagesOnStorefront" type="select" selector="#is_visible_on_front"/>
17+
<element name="usedForSortingInProductListing" type="select" selector="#used_for_sort_by"/>
1718
</section>
1819
</sections>

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

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
2626
<element name="addSelected" type="button" selector="//*[contains(text(),'Add Selected')]" timeout="30"/>
2727
<element name="deleteSpecificColorAttribute" type="button" selector="//input[@value='{{var}}']/../..//button[@class='action- scalable delete delete-option']" parameterized="true"/>
28+
<element name="attributeNameInGrid" type="text" selector="//td[contains(@class,'col-attribute_code') and contains(text(),'{{attribute_code}}')]/following-sibling::td[contains(@class,'col-frontend_label')]" parameterized="true"/>
2829
</section>
2930
</sections>
3031

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

+4
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,9 @@
8888
<element name="btnAdvancedInventory" type="button" selector="//button//span[text()='Advanced Inventory']/.."/>
8989
<element name="saveCategory" type="button" selector="//button[@data-action='close-advanced-select']" timeout="30"/>
9090
<element name="attributeRequiredInputField" type="select" selector="//select[contains(@name, 'product[{{attributeCode}}]')]" parameterized="true"/>
91+
<element name="customTextAttribute" type="input" selector="//input[@name='product[{{attribute_code}}]']" parameterized="true"/>
92+
<element name="customSelectAttribute" type="select" selector="//select[@name='product[{{attribute_code}}]']" parameterized="true"/>
93+
<element name="customSwitcherAttribute" type="checkbox" selector="//input[@name='product[{{attribute_code}}]' and @value='{{checked_value}}']/parent::div[@data-role='switcher']" parameterized="true"/>
94+
9195
</section>
9296
</sections>

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

+2
Original file line numberDiff line numberDiff line change
@@ -46,5 +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="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
50+
<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"/>
4951
</section>
5052
</sections>

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

+2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@
3131
<element name="seeLayeredNavigationCategoryVisualSwatch" type="text" selector="//div[@class='filter-options-title' and contains(text(),'attribute')]"/>
3232
<element name="seeTextSwatchOption" type="text" selector="//div[@class='swatch-option text ' and contains(text(),'textSwatchOption1')]"/>
3333
<element name="seeVisualSwatchOption" type="text" selector="//div[@class='swatch-option image ']/..//div[@data-option-label='visualSwatchOption2']"/>
34+
<element name="expandLayeredNavigationAttribute" type="button" selector="//div[@class='filter-options-title' and text()='{{AttributeName}}']" parameterized="true"/>
35+
<element name="layeredNavigationAttributeOptions" type="button" selector="//div[@class='filter-options-title' and text()='{{AttributeName}}']/following-sibling::div//a[text()='{{arg}}']" parameterized="true"/>
3436
</section>
3537
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
<comment userInput="Admin creates category." stepKey="adminCreatesCategoryComment" before="navigateToCategoryPage"/>
219219
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage"/>
220220
<!--Create category under Default Category-->
221-
<click selector="{{AdminCategorySidebarTreeSection.categoryTreeRoot}}" stepKey="clickDefaultCategory"/>
221+
<click selector="{{AdminCategorySidebarTreeSection.expandCategoryByName('Default Category')}}" stepKey="clickDefaultCategory"/>
222222
<actionGroup ref="CheckCategoryNameIsRequiredFieldActionGroup" stepKey="checkCategoryNameIsRequired"/>
223223
<actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory">
224224
<argument name="categoryEntity" value="_defaultCategory"/>
@@ -234,7 +234,7 @@
234234
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryPageToMoveCategory"/>
235235
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandTree"/>
236236
<dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}"
237-
selector2="{{AdminCategorySidebarTreeSection.categoryTreeRoot}}"
237+
selector2="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}"
238238
stepKey="dragAndDropCategory"/>
239239
<waitForPageLoad time="30" stepKey="waitForMoveConfirmation"/>
240240
<see selector="{{AdminCategoryModalSection.title}}" userInput="Warning Message" stepKey="seeMoveConfirmationModal"/>

0 commit comments

Comments
 (0)