Skip to content

Commit 4fb3e7b

Browse files
committed
MC-29124: Fix and unskip StorefrontSortingByPriceForConfigurableProductWithCatalogRuleAppliedTest
1 parent 4c7b1ce commit 4fb3e7b

File tree

3 files changed

+196
-1
lines changed

3 files changed

+196
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCatalogPriceRuleAddSkuConditionActionGroup">
11+
<annotations>
12+
<description>Create new product SKU based condition in Catalog Price Rule form.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productSku"/>
16+
</arguments>
17+
18+
<conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTabTitle}}" dependentSelector="{{AdminNewCatalogPriceRule.conditionsTabBody}}" visible="false" stepKey="openConditionsSectionIfNeeded"/>
19+
<scrollTo selector="{{AdminNewCatalogPriceRule.conditionsTabTitle}}" stepKey="scrollToConditionsFieldset"/>
20+
<waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForNewConditionButton"/>
21+
<click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="clickAddNewConditionButton"/>
22+
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" stepKey="selectConditionTypeSku"/>
23+
<waitForPageLoad stepKey="waitConditionFormRefresh"/>
24+
<click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" stepKey="clickEllipsis"/>
25+
<fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" stepKey="fillProductSku"/>
26+
<click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" stepKey="clickApply"/>
27+
</actionGroup>
28+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontCheckSortingByPriceForConfigurableWithCatalogRuleAppliedTest">
12+
<annotations>
13+
<features value="ConfigurableProduct"/>
14+
<stories value="Check sorting by price on storefront"/>
15+
<title value="Check sorting by price for Configurable product with Catalog Rule applied"/>
16+
<description value="Sort by price should be correct if the apply Catalog Rule to child product of configurable product"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-11926"/>
19+
<group value="catalog"/>
20+
<group value="catalogRule"/>
21+
<group value="configurableProduct"/>
22+
</annotations>
23+
<before>
24+
<createData entity="ApiCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
<field key="price">5.00</field>
28+
</createData>
29+
<createData entity="SimpleProduct" stepKey="createSimpleProduct2">
30+
<requiredEntity createDataKey="createCategory"/>
31+
<field key="price">10.00</field>
32+
</createData>
33+
<createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct">
34+
<requiredEntity createDataKey="createCategory"/>
35+
</createData>
36+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigurableProductAttribute"/>
37+
<createData entity="productAttributeOption1" stepKey="createConfigurableProductAttributeOption1">
38+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
39+
</createData>
40+
<createData entity="productAttributeOption2" stepKey="createConfigurableProductAttributeOption2">
41+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
42+
</createData>
43+
<createData entity="productAttributeOption3" stepKey="createConfigurableProductAttributeOption3">
44+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
45+
</createData>
46+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
47+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
48+
</createData>
49+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
50+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
51+
</getData>
52+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
53+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
54+
</getData>
55+
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
56+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
57+
</getData>
58+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
59+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
60+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
61+
<field key="price">15.00</field>
62+
</createData>
63+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
64+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
65+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
66+
<field key="price">20.00</field>
67+
</createData>
68+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
69+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
70+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
71+
<field key="price">25.00</field>
72+
</createData>
73+
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigurableProductOption">
74+
<requiredEntity createDataKey="createConfigurableProduct"/>
75+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
76+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
77+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
78+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
79+
</createData>
80+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigurableProductAddChild1">
81+
<requiredEntity createDataKey="createConfigurableProduct"/>
82+
<requiredEntity createDataKey="createConfigChildProduct1"/>
83+
</createData>
84+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigurableProductAddChild2">
85+
<requiredEntity createDataKey="createConfigurableProduct"/>
86+
<requiredEntity createDataKey="createConfigChildProduct2"/>
87+
</createData>
88+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigurableProductAddChild3">
89+
<requiredEntity createDataKey="createConfigurableProduct"/>
90+
<requiredEntity createDataKey="createConfigChildProduct3"/>
91+
</createData>
92+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
93+
<!--SKU Product Attribute is enabled for Promo Rule Conditions-->
94+
<actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute">
95+
<argument name="ProductAttribute" value="sku"/>
96+
</actionGroup>
97+
<actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes">
98+
<argument name="option" value="Yes"/>
99+
</actionGroup>
100+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllRules"/>
101+
<magentoCLI command="indexer:reindex" stepKey="reindexIndices"/>
102+
</before>
103+
104+
<after>
105+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
106+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
107+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
108+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
109+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
110+
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/>
111+
<deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigProduct"/>
112+
<deleteData createDataKey="createConfigurableProductAttribute" stepKey="deleteConfigProductAttribute"/>
113+
114+
<!--SKU Product Attribute is disable for Promo Rule Conditions-->
115+
<actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute">
116+
<argument name="ProductAttribute" value="sku"/>
117+
</actionGroup>
118+
<actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo">
119+
<argument name="option" value="No"/>
120+
</actionGroup>
121+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllRules"/>
122+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
123+
</after>
124+
125+
<!--Open category with products and Sort by price desc-->
126+
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage">
127+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
128+
<argument name="mode" value="grid"/>
129+
<argument name="numOfProductsPerPage" value="25"/>
130+
<argument name="sortBy" value="price"/>
131+
<argument name="sort" value="desc"/>
132+
</actionGroup>
133+
<see selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" userInput="$$createConfigurableProduct.name$$" stepKey="seeConfigurableProduct"/>
134+
<see selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo"/>
135+
<see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct"/>
136+
137+
<!--Create and apply catalog price rule-->
138+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingCatalogPriceRule"/>
139+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForCatalogPriceRule">
140+
<argument name="groups" value="'NOT LOGGED IN'"/>
141+
</actionGroup>
142+
<actionGroup ref="AdminCatalogPriceRuleAddSkuConditionActionGroup" stepKey="addProductSkuBasedCondition">
143+
<argument name="productSku" value="$createConfigChildProduct3.sku$"/>
144+
</actionGroup>
145+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule">
146+
<argument name="apply" value="{{CatalogRuleByPercentWith96Amount.simple_action}}"/>
147+
<argument name="discountAmount" value="{{CatalogRuleByPercentWith96Amount.discount_amount}}"/>
148+
</actionGroup>
149+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/>
150+
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
151+
152+
<!--Reopen category with products and Sort by price desc-->
153+
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage2">
154+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
155+
<argument name="mode" value="grid"/>
156+
<argument name="numOfProductsPerPage" value="9"/>
157+
<argument name="sortBy" value="price"/>
158+
<argument name="sort" value="desc"/>
159+
</actionGroup>
160+
<see selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo2"/>
161+
<see selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/>
162+
<see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createConfigurableProduct.name$$" stepKey="seeConfigurableProduct2"/>
163+
</test>
164+
</tests>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<annotations>
1313
<features value="ConfigurableProduct"/>
1414
<stories value="View soting by price in storefront"/>
15-
<title value="Sorting by price for Configurable with Catalog Rule applied"/>
15+
<title value="DEPRECATED. Sorting by price for Configurable with Catalog Rule applied"/>
1616
<description value="Sort by price should be correct if the apply Catalog Rule to child product of configurable product"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-69988"/>
1919
<group value="configurable_product"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use StorefrontCheckSortingByPriceForConfigurableWithCatalogRuleAppliedTest instead.</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<createData entity="ApiCategory" stepKey="createCategory"/>

0 commit comments

Comments
 (0)