Skip to content

Commit

Permalink
Merge pull request #8784 from magento-gl/ACQE-6193_mainline_PR_deploy…
Browse files Browse the repository at this point in the history
…ment

[Bengals Team] Test Fixes and Automation Tasks
  • Loading branch information
KevinBKozan authored Apr 8, 2024
2 parents 488c103 + 168b5ff commit b072f7b
Show file tree
Hide file tree
Showing 19 changed files with 624 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminUpdateAttributeUsedForSortingInProductListingActionGroup">
<annotations>
<description>Admin selects the values for "Use For Sorting in Product Listing" for created attribute </description>
</annotations>
<arguments>
<argument name="usedForSortingInProductListing" type="string" defaultValue="Yes"/>
</arguments>
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="navigateToStorefrontPropertiesTab"/>
<waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitForStorefrontPropertiesTabLoad"/>
<selectOption selector="{{StorefrontPropertiesSection.usedForSortingInProductListing}}" userInput="{{usedForSortingInProductListing}}" stepKey="setValueForSortingInProductListing"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertProductSortingBasedOnAttributesInStorefrontCategoryPageActionGroup">
<annotations>
<description>Goes to the Storefront page. Validates the sorting of products based on the attributes.</description>
</annotations>
<arguments>
<argument name="product1" defaultValue="product"/>
<argument name="product2" defaultValue="product"/>
<argument name="sortBy" type="string"/>
</arguments>
<selectOption userInput="{{sortBy}}" selector="{{StorefrontCategoryTopToolbarSection.sortByDropdown}}" stepKey="selectSortBy"/>
<waitForPageLoad stepKey="waitForPageLoadPostSelectingSortBy"/>
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productInOrderDisplay('1',product1.name)}}" stepKey="assertsTheProductAtIndex1"/>
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productInOrderDisplay('2',product2.name)}}" stepKey="assertsTheProductAtIndex2"/>
</actionGroup>
</actionGroups>
23 changes: 23 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,27 @@
<data key="attribute_code">attribute</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelForExportImport</requiredEntity>
</entity>
<!-- Product attributes for sorting in product listing as No -->
<entity name="textAttributeWithNoProductSortListing" extends="newProductAttribute" type="ProductAttribute">
<data key="used_for_sort_by">false</data>
</entity>
<entity name="dateAttributeWithNoProductSortListing" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">date</data>
<data key="used_for_sort_by">false</data>
</entity>
<entity name="yesNoAttributeWithNoProductSortListing" extends="productYesNoAttribute" type="ProductAttribute">
<data key="used_for_sort_by">false</data>
</entity>
<entity name="dropdownAttributeWithNoProductSortListing" extends="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
<data key="used_for_sort_by">false</data>
</entity>
<entity name="multiSelectAttributeWithNoProductSortListing" extends="productDropDownAttribute" type="ProductAttribute">
<data key="frontend_input">multiselect</data>
<data key="used_for_sort_by">false</data>
</entity>
<entity name="priceAttributeWithNoProductSortListing" extends="newProductAttribute" type="ProductAttribute">
<data key="frontend_input">price</data>
<data key="used_for_sort_by">false</data>
</entity>
</entities>

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<element name="useForPromoRuleConditions" type="select" selector="#is_used_for_promo_rules"/>
<element name="StorefrontPropertiesSectionToggle" type="button" selector="#front_fieldset-wrapper"/>
<element name="visibleOnCatalogPagesOnStorefront" type="select" selector="#is_visible_on_front"/>
<element name="usedForSortingInProductListing" type="select" selector="#used_for_sort_by"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
<element name="addSelected" type="button" selector="//*[contains(text(),'Add Selected')]" timeout="30"/>
<element name="deleteSpecificColorAttribute" type="button" selector="//input[@value='{{var}}']/../..//button[@class='action- scalable delete delete-option']" parameterized="true"/>
<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"/>
</section>
</sections>

Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,9 @@
<element name="btnAdvancedInventory" type="button" selector="//button//span[text()='Advanced Inventory']/.."/>
<element name="saveCategory" type="button" selector="//button[@data-action='close-advanced-select']" timeout="30"/>
<element name="attributeRequiredInputField" type="select" selector="//select[contains(@name, 'product[{{attributeCode}}]')]" parameterized="true"/>
<element name="customTextAttribute" type="input" selector="//input[@name='product[{{attribute_code}}]']" parameterized="true"/>
<element name="customSelectAttribute" type="select" selector="//select[@name='product[{{attribute_code}}]']" parameterized="true"/>
<element name="customSwitcherAttribute" type="checkbox" selector="//input[@name='product[{{attribute_code}}]' and @value='{{checked_value}}']/parent::div[@data-role='switcher']" parameterized="true"/>

</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@
<element name="outOfStockProductCategoryPage" type="text" selector="//div[@class='stock unavailable']//span[text()='Out of stock']"/>
<element name="ListedProductAttributes" type="block" selector="//div[@aria-label='{{vs_attribute}}']//div[@aria-label='{{attribute_name}}']" parameterized="true"/>
<element name="quickOrderLink" type="text" selector="//div[@class='panel header']//a[text()='Quick Order']" />
<element name="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
<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"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@
<element name="seeLayeredNavigationCategoryVisualSwatch" type="text" selector="//div[@class='filter-options-title' and contains(text(),'attribute')]"/>
<element name="seeTextSwatchOption" type="text" selector="//div[@class='swatch-option text ' and contains(text(),'textSwatchOption1')]"/>
<element name="seeVisualSwatchOption" type="text" selector="//div[@class='swatch-option image ']/..//div[@data-option-label='visualSwatchOption2']"/>
<element name="expandLayeredNavigationAttribute" type="button" selector="//div[@class='filter-options-title' and text()='{{AttributeName}}']" parameterized="true"/>
<element name="layeredNavigationAttributeOptions" type="button" selector="//div[@class='filter-options-title' and text()='{{AttributeName}}']/following-sibling::div//a[text()='{{arg}}']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<comment userInput="Admin creates category." stepKey="adminCreatesCategoryComment" before="navigateToCategoryPage"/>
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage"/>
<!--Create category under Default Category-->
<click selector="{{AdminCategorySidebarTreeSection.categoryTreeRoot}}" stepKey="clickDefaultCategory"/>
<click selector="{{AdminCategorySidebarTreeSection.expandCategoryByName('Default Category')}}" stepKey="clickDefaultCategory"/>
<actionGroup ref="CheckCategoryNameIsRequiredFieldActionGroup" stepKey="checkCategoryNameIsRequired"/>
<actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory">
<argument name="categoryEntity" value="_defaultCategory"/>
Expand All @@ -232,7 +232,7 @@
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryPageToMoveCategory"/>
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandTree"/>
<dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}"
selector2="{{AdminCategorySidebarTreeSection.categoryTreeRoot}}"
selector2="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}"
stepKey="dragAndDropCategory"/>
<waitForPageLoad time="30" stepKey="waitForMoveConfirmation"/>
<see selector="{{AdminCategoryModalSection.title}}" userInput="Warning Message" stepKey="seeMoveConfirmationModal"/>
Expand Down
Loading

0 comments on commit b072f7b

Please sign in to comment.