Skip to content

Commit 46479de

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-4114' into functional-testing-automation
2 parents b3f3913 + 858d525 commit 46479de

File tree

7 files changed

+470
-0
lines changed

7 files changed

+470
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminToggleAnchorSwitchActionGroup">
12+
<annotations>
13+
<description>Admin enable or disable Anchor Switch for any category.</description>
14+
</annotations>
15+
<scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/>
16+
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/>
17+
<click selector="{{AdminCategoryBasicFieldSection.anchorSwitch}}" stepKey="toggleSwitchAnchorCategory"/>
18+
<wait time="10" stepKey="waitToChangeAnchorSwitchStatus"/>
19+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
20+
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
21+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
22+
</actionGroup>
23+
</actionGroups>
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<!-- On a category page with layered navigation, verify if the category filter item is present -->
10+
<actionGroup name="AssertStorefrontLayeredNavigationCategoryAndPriceActionGroup">
11+
<annotations>
12+
<description>Layered Navigation Category And Price validation.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="minPrice" type="string"/>
16+
<argument name="maxPrice" type="string"/>
17+
<argument name="count" type="string"/>
18+
<argument name="minPrice2" type="string"/>
19+
<argument name="maxPrice2" type="string"/>
20+
</arguments>
21+
<!-- Verify category and price layered navigation item is present -->
22+
<see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="Category" stepKey="seeCategoryFilterInLayeredNav"/>
23+
<click selector="{{StorefrontCategorySidebarSection.expandCategoryLayeredNavigationButton}}" stepKey="expandCategoryLayeredNavigation"/>
24+
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationCategory}}" stepKey="verifyCat"/>
25+
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationCategoryProductQty}}" stepKey="verifyQuantity"/>
26+
<click selector="{{StorefrontCategorySidebarSection.expandPriceLayeredNavigationButton}}" stepKey="expandPriceLayeredNavigation"/>
27+
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationFirstPriceRange(minPrice, maxPrice, count)}}" stepKey="verifyPriceRange1"/>
28+
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationSecondPriceRange(minPrice2,maxPrice2,count)}}" stepKey="verifyPriceRange2"/>
29+
</actionGroup>
30+
</actionGroups>
Lines changed: 21 additions & 0 deletions
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="StorefrontGoToSubSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup">
12+
<arguments>
13+
<argument name="subCategoryName" type="string"/>
14+
<argument name="subSubCategoryName" type="string"/>
15+
</arguments>
16+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
17+
<waitForPageLoad stepKey="waitForSubCategoryPage"/>
18+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="toSubCategory" after="toCategory"/>
19+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subSubCategoryName)}}" stepKey="openSubSubCategory" after="toSubCategory"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,15 @@
2525
<element name="scheduleDesignUpdateTab" type="block" selector="div[data-index='schedule_design_update']" timeout="15"/>
2626
<element name="categoryNameRequiredField" type="text" selector="//label[@class='admin__field-error' and contains(text(),'This is a required field.')]" timeout="15"/>
2727
<element name="urlExistsErrorMessage" type="text" selector="//div[@class='message message-error error']//h4[contains(text(),'The value specified in the URL Key field would generate a URL that already exists.')]" timeout="30"/>
28+
<element name="presenceProductsInCategory" type="text" selector="//div[@class='admin__data-grid-wrap admin__data-grid-wrap-static']//td[3]" timeout="30"/>
29+
<element name="anchorSwitch" type="input" selector="//input[@name='is_anchor']/../..//div[@class='admin__actions-switch']" timeout="30"/>
30+
<element name="categoryTreeForThree" type="input" selector="//span[contains(text(),'{{var1}}')]/../../..//ul//a//span[contains(text(),'{{var2}}')]/../../..//ul//a/span[contains(text(),'{{var3}}')]" parameterized="true"/>
31+
<element name="categoryTreeForFour" type="input" selector="//span[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../../..//ul//a//span[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../../..//ul//a/span[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../../..//li[2]//a/span[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]" parameterized="true"/>
32+
<element name="categoryTreeForFive" type="input" selector="//span[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../../..//ul//a//span[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../../..//ul//a/span[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../../..//li[2]//a/span[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]/.././../..//ul//a/span[contains(text(),'{{CatE}}') and contains(text(),'({{qty5}})')]" parameterized="true"/>
33+
<element name="sourceCategory" type="text" selector="//div[@class='x-tree-node-el folder active-category x-tree-node-leaf x-tree-selected']//a/span[contains(text(),'{{var1}}')]" parameterized="true"/>
34+
<element name="destinationCategory" type="text" selector="//div[@class='x-tree-node-el folder active-category x-tree-node-expanded']//a/span[contains(text(),'Default Category')]"/>
35+
36+
<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']"/>
37+
<element name="acceptPopUp" type="input" selector="//div[@class='modal-inner-wrap']//button[@class='action-primary']/span[text()='Ok']"/>
2838
</section>
2939
</sections>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,12 @@
2020
<element name="enabledFilterOptionItemByLabel" type="text" selector="//div[contains(@class, 'filter-options')]//li[@class='item']//a[contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>
2121
<element name="disabledFilterOptionItemByLabel" type="text" selector="//div[contains(@class, 'filter-options')]//li[@class='item' and contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>
2222
<element name="visibleOptionQty" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a .count" parameterized="true" timeout="30"/>
23+
<element name="shopByCategoryLinkButton" type="button" selector="//div[@class='sidebar sidebar-main']//strong[text()='Shop By']/../..//dt[text()='Category']/..//a[text()='{{var1}}']/..//span[contains(text(),' 1 ')]" parameterized="true"/>
24+
<element name="expandCategoryLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Category']"/>
25+
<element name="seeLayeredNavigationCategory" type="button" selector="//div[@class='filter-options-content']//a[contains(text(),'SecondLevel')]"/>
26+
<element name="seeLayeredNavigationCategoryProductQty" type="button" selector="//*[@id='narrow-by-list']/div[1]/div[2]/ol/li/a/span"/>
27+
<element name="expandPriceLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Price']"/>
28+
<element name="seeLayeredNavigationFirstPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice}}']/..//span[@class='price' and text()='${{maxPrice}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
29+
<element name="seeLayeredNavigationSecondPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice2}}']/../..//a[text()='{{maxPrice2}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
2330
</section>
2431
</sections>

0 commit comments

Comments
 (0)