Skip to content

Commit 1e04c7d

Browse files
shashikant.kumarshashikant.kumar
authored andcommitted
AC-4114 : AlterAnchorCategoryTest
1 parent 320a0fe commit 1e04c7d

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontLayeredNavigationCategoryAndPriceActionGroup.xml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@
1616
<argument name="maxPrice" type="string"/>
1717
<argument name="count" type="string"/>
1818
<argument name="minPrice2" type="string"/>
19+
<argument name="maxPrice2" type="string"/>
1920
</arguments>
20-
<!-- Verify category and filter item is present -->
21-
<see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="Category" stepKey="seeCategoryFilterInLayeredNav"/>
22-
<click selector="{{StorefrontCategorySidebarSection.expandCategoryLayeredNavigationButton}}" stepKey="expandCategoryLayeredNavigation"/>
23-
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationCategory}}" stepKey="verifyCat"/>
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"/>
2425
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationCategoryProductQty}}" stepKey="verifyQuantity"/>
25-
<click selector="{{StorefrontCategorySidebarSection.expandPriceLayeredNavigationButton}}" stepKey="expandPriceLayeredNavigation"/>
26-
<!-- <seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationFirstPriceRange(minPrice maxPrice count)}}" stepKey="verifyPriceRange1"/>
27-
<seeElement selector="{{StorefrontCategorySidebarSection.seeLayeredNavigationSecondPriceRange(minPrice2 count)}}" stepKey="verifyPriceRange2"/>
28-
-->
29-
<seeElement selector="//a//span[@class='price' and text()='{{minPrice}}']/..//span[@class='price' and text()='{{maxPrice}}']/..//span[@class='count' and text()=( {{count}})]" stepKey="verifyPriceRange1"/>
30-
<seeElement selector="//a//span[@class='price' and text()='{{minPrice2}}']/../..//a[text()=' and above']/..//span[@class='count' and text()=( {{count}})]" stepKey="verifyPriceRange2"/>
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"/>
3129
</actionGroup>
3230
</actionGroups>

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@
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"/>
2323
<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-
2524
<element name="expandCategoryLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Category']"/>
2625
<element name="seeLayeredNavigationCategory" type="button" selector="//div[@class='filter-options-content']//a[contains(text(),'SecondLevel')]"/>
2726
<element name="seeLayeredNavigationCategoryProductQty" type="button" selector="//*[@id='narrow-by-list']/div[1]/div[2]/ol/li/a/span"/>
28-
2927
<element name="expandPriceLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Price']"/>
30-
<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"/>
31-
<element name="seeLayeredNavigationSecondPriceRange" type="button" selector="//a//span[@class='price' and text()='{{minPrice2}}']/../..//a[text()=' and above']/..//span[@class='count' and text()=( {{count}})]" parameterized="true"/>
32-
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"/>
3330
</section>
3431
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/SampleTest.xml renamed to app/code/Magento/Catalog/Test/Mftf/Test/AlterAnchorCategoryTest.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="SampleTest">
11+
<test name="AlterAnchorCategoryTest">
1212
<annotations>
1313
<stories value="Admin Can Alter Category Anchor setting"/>
1414
<title value="Alter Category Anchor setting"/>
1515
<description value="Admin Can Alter Category Anchor setting and it should work perfectly"/>
16-
<severity value="CRITICAL"/>
16+
<severity value="MAJOR"/>
1717
<testCaseId value="AC-4114"/>
1818
</annotations>
1919
<before>
@@ -49,10 +49,11 @@
4949
<argument name="productName" value="$$createSecondSimpleProduct.name$$"/>
5050
</actionGroup>
5151
<actionGroup ref="AssertStorefrontLayeredNavigationCategoryAndPriceActionGroup" stepKey="checkCategoryAndPriceLayeredNavigationIsPresent">
52-
<argument name="minPrice" value="$10.00"/>
53-
<argument name="maxPrice" value="$19.99"/>
52+
<argument name="minPrice" value="10.00"/>
53+
<argument name="maxPrice" value="19.99"/>
5454
<argument name="count" value="1"/>
55-
<argument name="minPrice2" value="$90.00"/>
55+
<argument name="minPrice2" value="90.00"/>
56+
<argument name="maxPrice2" value=" and above"/>
5657
</actionGroup>
5758
<!--Goto Category in admin side and do validation for single Product visibility validation-->
5859
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
@@ -96,10 +97,11 @@
9697
<argument name="productName" value="$$createSecondSimpleProduct.name$$"/>
9798
</actionGroup>
9899
<actionGroup ref="AssertStorefrontLayeredNavigationCategoryAndPriceActionGroup" stepKey="checkCategoryAndPriceFilterIsPresent1">
99-
<argument name="minPrice" value="$10.00"/>
100-
<argument name="maxPrice" value="$19.99"/>
100+
<argument name="minPrice" value="10.00"/>
101+
<argument name="maxPrice" value="19.99"/>
101102
<argument name="count" value="1"/>
102-
<argument name="minPrice2" value="$90.00"/>
103+
<argument name="minPrice2" value="90.00"/>
104+
<argument name="maxPrice2" value=" and above"/>
103105
</actionGroup>
104106
<!-- Drag drop Category and do Validation for Category and Products on StoreFront-->
105107
<actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openAdminCategoryPage2"/>

0 commit comments

Comments
 (0)