Skip to content

Commit 044afa5

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-95174' into 2.3-develop-mftf-pr7
2 parents 99e594d + 0a855f8 commit 044afa5

File tree

9 files changed

+232
-3
lines changed

9 files changed

+232
-3
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,26 @@
1717
<click selector="{{AdminProductAttributeGridSection.AttributeCode(ProductAttribute.attribute_code)}}" stepKey="navigateToAttributeEditPage1" />
1818
<waitForPageLoad stepKey="waitForPageLoad2" />
1919
</actionGroup>
20+
<actionGroup name="navigateToEditProductAttribute">
21+
<arguments>
22+
<argument name="ProductAttribute" type="string"/>
23+
</arguments>
24+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
25+
<waitForPageLoad stepKey="waitForPageLoad1"/>
26+
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1" />
27+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2" />
28+
<waitForPageLoad stepKey="waitForPageLoad2" />
29+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3" />
30+
<waitForPageLoad stepKey="waitForPageLoad3" />
31+
</actionGroup>
32+
<actionGroup name="changeUseForPromoRuleConditionsProductAttribute">
33+
<arguments>
34+
<argument name="option" type="string"/>
35+
</arguments>
36+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
37+
<waitForPageLoad stepKey="waitForPageLoad"/>
38+
<selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/>
39+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/>
40+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/>
41+
</actionGroup>
2042
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
<argument name="mode" type="string"/>
1616
<argument name="numOfProductsPerPage" type="string"/>
1717
<argument name="sortBy" type="string" defaultValue="position"/>
18+
<argument name="sort" type="string" defaultValue="asc"/>
1819
</arguments>
1920
<!-- Go to storefront category page -->
20-
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&amp;product_list_mode={{mode}}&amp;product_list_order={{sortBy}}" stepKey="onCategoryPage"/>
21+
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&amp;product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
2122
<waitForPageLoad stepKey="waitForPageLoad"/>
2223
</actionGroup>
2324

app/code/Magento/Catalog/Test/Mftf/Data/FrontendLabelData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<data key="store_id">0</data>
1717
<data key="label" unique="suffix">attributeTwo</data>
1818
</entity>
19+
<entity name="ProductAttributeFrontendLabelThree" type="FrontendLabel">
20+
<data key="store_id">0</data>
21+
<data key="label" unique="suffix">attributeThree</data>
22+
</entity>
1923
</entities>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
1818
<waitForPageLoad stepKey="waitForPriceRulePage"/>
1919
<click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
20-
<waitForPageLoad stepKey="waitForIndividualRulePage"/>
2120

2221
<!-- Fill the form according the attributes of the entity -->
2322
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
@@ -44,4 +43,19 @@
4443
<click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/>
4544
<see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/>
4645
</actionGroup>
46+
47+
<!--Add Catalog Rule Condition With product SKU-->
48+
<actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="newCatalogPriceRuleByUI">
49+
<arguments>
50+
<argument name="productSku"/>
51+
</arguments>
52+
<click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
53+
<waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/>
54+
<click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/>
55+
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/>
56+
<waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/>
57+
<click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/>
58+
<fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/>
59+
<click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/>
60+
</actionGroup>
4761
</actionGroups>

app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,18 @@
6363
<data key="simple_action">to_fixed</data>
6464
<data key="discount_amount">110.7</data>
6565
</entity>
66+
67+
<entity name="CatalogRuleByPercentWith96Amount" type="catalogRule">
68+
<data key="name" unique="suffix">CatalogPriceRule</data>
69+
<data key="description">Catalog Price Rule Description</data>
70+
<data key="is_active">1</data>
71+
<array key="customer_group_ids">
72+
<item>0</item>
73+
</array>
74+
<array key="website_ids">
75+
<item>1</item>
76+
</array>
77+
<data key="simple_action">by_percent</data>
78+
<data key="discount_amount">96</data>
79+
</entity>
6680
</entities>

app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</section>
3939

4040
<section name="AdminNewCatalogPriceRuleConditions">
41-
<element name="newCondition" type="button" selector="span.rule-param-new-child"/>
41+
<element name="newCondition" type="button" selector=".rule-param.rule-param-new-child"/>
4242
<element name="conditionSelect" type="select" selector="select#conditions__{{var}}__new_child" parameterized="true"/>
4343
<element name="targetEllipsis" type="button" selector="//li[{{var}}]//a[@class='label'][text() = '...']" parameterized="true"/>
4444
<element name="targetInput" type="input" selector="input#conditions__{{var1}}--{{var2}}__value" parameterized="true"/>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductOptionData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@
1414
<requiredEntity type="ValueIndex">ValueIndex1</requiredEntity>
1515
<requiredEntity type="ValueIndex">ValueIndex2</requiredEntity>
1616
</entity>
17+
<entity name="ConfigurableProductThreeOptions" type="ConfigurableProductOption">
18+
<var key="attribute_id" entityKey="attribute_id" entityType="ProductAttribute" />
19+
<data key="label">option</data>
20+
<requiredEntity type="ValueIndex">ValueIndex1</requiredEntity>
21+
<requiredEntity type="ValueIndex">ValueIndex2</requiredEntity>
22+
<requiredEntity type="ValueIndex">ValueIndex3</requiredEntity>
23+
</entity>
1724
</entities>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ValueIndexData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@
1414
<entity name="ValueIndex2" type="ValueIndex">
1515
<var key="value_index" entityKey="value" entityType="ProductAttributeOption"/>
1616
</entity>
17+
<entity name="ValueIndex3" type="ValueIndex">
18+
<var key="value_index" entityKey="value" entityType="ProductAttributeOption"/>
19+
</entity>
1720
</entities>
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="StorefrontSortingByPriceForConfigurableProductWithCatalogRuleAppliedTest">
12+
<annotations>
13+
<features value="ConfigurableProduct"/>
14+
<stories value="View soting by price in storefront"/>
15+
<title value="Sorting by price for Configurable 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="MAGETWO-69988"/>
19+
<group value="сonfigurable_product"/>
20+
</annotations>
21+
<before>
22+
<createData entity="ApiCategory" stepKey="createCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
<field key="price">5.00</field>
26+
</createData>
27+
<createData entity="SimpleProduct" stepKey="createSimpleProduct2">
28+
<requiredEntity createDataKey="createCategory"/>
29+
<field key="price">10.00</field>
30+
</createData>
31+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
32+
<requiredEntity createDataKey="createCategory"/>
33+
</createData>
34+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
35+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
36+
<requiredEntity createDataKey="createConfigProductAttribute"/>
37+
</createData>
38+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
</createData>
41+
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3">
42+
<requiredEntity createDataKey="createConfigProductAttribute"/>
43+
</createData>
44+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
45+
<requiredEntity createDataKey="createConfigProductAttribute"/>
46+
</createData>
47+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
48+
<requiredEntity createDataKey="createConfigProductAttribute"/>
49+
</getData>
50+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
51+
<requiredEntity createDataKey="createConfigProductAttribute"/>
52+
</getData>
53+
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
54+
<requiredEntity createDataKey="createConfigProductAttribute"/>
55+
</getData>
56+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
57+
<requiredEntity createDataKey="createConfigProductAttribute"/>
58+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
59+
<field key="price">15.00</field>
60+
</createData>
61+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
62+
<requiredEntity createDataKey="createConfigProductAttribute"/>
63+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
64+
<field key="price">20.00</field>
65+
</createData>
66+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
67+
<requiredEntity createDataKey="createConfigProductAttribute"/>
68+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
69+
<field key="price">25.00</field>
70+
</createData>
71+
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
72+
<requiredEntity createDataKey="createConfigProduct"/>
73+
<requiredEntity createDataKey="createConfigProductAttribute"/>
74+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
75+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
76+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
77+
</createData>
78+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
79+
<requiredEntity createDataKey="createConfigProduct"/>
80+
<requiredEntity createDataKey="createConfigChildProduct1"/>
81+
</createData>
82+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
83+
<requiredEntity createDataKey="createConfigProduct"/>
84+
<requiredEntity createDataKey="createConfigChildProduct2"/>
85+
</createData>
86+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3">
87+
<requiredEntity createDataKey="createConfigProduct"/>
88+
<requiredEntity createDataKey="createConfigChildProduct3"/>
89+
</createData>
90+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
91+
<!--SKU Product Attribute is enabled for Promo Rule Conditions-->
92+
<actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute">
93+
<argument name="ProductAttribute" value="sku"/>
94+
</actionGroup>
95+
<actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes">
96+
<argument name="option" value="Yes"/>
97+
</actionGroup>
98+
<magentoCLI command="indexer:reindex" stepKey="reindex1"/>
99+
<magentoCLI command="cache:flush" stepKey="flushCache1"/>
100+
</before>
101+
102+
<after>
103+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
104+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
105+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
106+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
107+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
108+
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/>
109+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
110+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
111+
112+
<!--SKU Product Attribute is disable for Promo Rule Conditions-->
113+
<actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute">
114+
<argument name="ProductAttribute" value="sku"/>
115+
</actionGroup>
116+
<actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo">
117+
<argument name="option" value="No"/>
118+
</actionGroup>
119+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
120+
</after>
121+
122+
<!--Open category with products and Sort by price desc-->
123+
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage">
124+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
125+
<argument name="mode" value="grid"/>
126+
<argument name="numOfProductsPerPage" value="25"/>
127+
<argument name="sortBy" value="price"/>
128+
<argument name="sort" value="desc"/>
129+
</actionGroup>
130+
<see selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProduct"/>
131+
<see selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo"/>
132+
<see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct"/>
133+
134+
<!--Create and apply catalog price rule-->
135+
<actionGroup ref="newCatalogPriceRuleByUIWithConditionIsSKU" stepKey="createCatalogPriceRule">
136+
<argument name="catalogRule" value="CatalogRuleByPercentWith96Amount" />
137+
<argument name="productSku" value="$$createConfigChildProduct3.sku$$" />
138+
</actionGroup>
139+
<actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/>
140+
<click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/>
141+
142+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
143+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
144+
145+
<!--Reopen category with products and Sort by price desc-->
146+
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage2">
147+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
148+
<argument name="mode" value="grid"/>
149+
<argument name="numOfProductsPerPage" value="9"/>
150+
<argument name="sortBy" value="price"/>
151+
<argument name="sort" value="desc"/>
152+
</actionGroup>
153+
<see selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo2"/>
154+
<see selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/>
155+
<see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProduct2"/>
156+
157+
<!-- Delete the rule -->
158+
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/>
159+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
160+
<argument name="name" value="{{CatalogRuleByPercentWith96Amount.name}}"/>
161+
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
162+
</actionGroup>
163+
</test>
164+
</tests>

0 commit comments

Comments
 (0)