Skip to content

Commit 91ad93b

Browse files
Manoranjan.PrakashManoranjan.Prakash
authored andcommitted
AC-4555: Test case automated as per the review comments
1 parent b2286ec commit 91ad93b

File tree

9 files changed

+409
-0
lines changed

9 files changed

+409
-0
lines changed
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

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
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+
18+
<element name="usedForSortingInProductListing" type="select" selector="#used_for_sort_by"/>
1719
</section>
1820
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
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+
29+
<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"/>
30+
2831
</section>
2932
</sections>
3033

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,10 @@
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+
92+
<element name="customTextAttribute" type="input" selector="//input[@name='product[{{attribute_code}}]']" parameterized="true"/>
93+
<element name="customSelectAttribute" type="select" selector="//select[@name='product[{{attribute_code}}]']" parameterized="true"/>
94+
<element name="customSwitcherAttribute" type="checkbox" selector="//input[@name='product[{{attribute_code}}]' and @value='{{checked_value}}']/parent::div[@data-role='switcher']" parameterized="true"/>
95+
9196
</section>
9297
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@
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+
50+
<element name="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
51+
<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"/>
4952
</section>
5053
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
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+
35+
<element name="expandLayeredNavigationAttribute" type="button" selector="//div[@class='filter-options-title' and text()='{{AttributeName}}']" parameterized="true"/>
36+
<element name="layeredNavigationAttributeOptions" type="button" selector="//div[@class='filter-options-title' and text()='{{AttributeName}}']/following-sibling::div//a[text()='{{arg}}']" parameterized="true"/>
3437
</section>
3538
</sections>

0 commit comments

Comments
 (0)