Skip to content

Commit 6783060

Browse files
authored
Merge pull request #6150 from magento-tsg/2.4-develop-sidecar-pr1
[Sidecar] Tests for 2.4 (pr1)
2 parents 28020ae + 5a5a1c1 commit 6783060

9 files changed

+399
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminFillCatalogRuleConditionWithSelectAttributeActionGroup" extends="AdminFillCatalogRuleConditionActionGroup">
12+
<annotations>
13+
<description>EXTENDS: AdminFillCatalogRuleConditionActionGroup. Clicks on the Conditions tab. Fills in the provided condition with attribute type select.</description>
14+
</annotations>
15+
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/>
16+
<remove keyForRemoval="clickApply"/>
17+
<remove keyForRemoval="waitForApplyButtonInvisibility"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
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="AdminApplyCatalogPriceRuleByProductAttributeTest">
12+
<annotations>
13+
<features value="CatalogRule"/>
14+
<stories value="Catalog price rule"/>
15+
<title value="Admin should be able to apply the catalog price rule by product attribute"/>
16+
<description value="Admin should be able to apply the catalog price rule by product attribute"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-25351"/>
19+
<group value="catalogRule"/>
20+
</annotations>
21+
<before>
22+
<createData entity="productDropDownAttribute" stepKey="createDropdownAttribute"/>
23+
<!--Create attribute options-->
24+
<createData entity="ProductAttributeOption7" stepKey="createProductAttributeOptionGreen">
25+
<requiredEntity createDataKey="createDropdownAttribute"/>
26+
</createData>
27+
<createData entity="ProductAttributeOption8" stepKey="createProductAttributeOptionRed">
28+
<requiredEntity createDataKey="createDropdownAttribute"/>
29+
</createData>
30+
<!--Add attribute to default attribute set-->
31+
<createData entity="AddToDefaultSet" stepKey="addAttributeToDefaultSet">
32+
<requiredEntity createDataKey="createDropdownAttribute"/>
33+
</createData>
34+
35+
<createData entity="ApiCategory" stepKey="createCategory"/>
36+
<createData entity="ApiSimpleProduct" stepKey="createFirstProduct">
37+
<field key="price">40.00</field>
38+
<requiredEntity createDataKey="createCategory"/>
39+
</createData>
40+
<createData entity="ApiSimpleProduct" stepKey="createSecondProduct">
41+
<field key="price">40.00</field>
42+
<requiredEntity createDataKey="createCategory"/>
43+
</createData>
44+
45+
<!-- Create the configurable product based on the data in the /data folder -->
46+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
47+
<requiredEntity createDataKey="createCategory"/>
48+
</createData>
49+
50+
<!-- Make the configurable product have two options, that are children of the default attribute set -->
51+
<createData entity="productAttributeWithTwoOptionsNotVisible" stepKey="createConfigProductAttribute"/>
52+
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeOption">
53+
<requiredEntity createDataKey="createConfigProductAttribute"/>
54+
</createData>
55+
<createData entity="productAttributeOption2" stepKey="createSecondConfigProductAttributeOption">
56+
<requiredEntity createDataKey="createConfigProductAttribute"/>
57+
</createData>
58+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
59+
<requiredEntity createDataKey="createConfigProductAttribute"/>
60+
</createData>
61+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeOption">
62+
<requiredEntity createDataKey="createConfigProductAttribute"/>
63+
</getData>
64+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSecondConfigAttributeOption">
65+
<requiredEntity createDataKey="createConfigProductAttribute"/>
66+
</getData>
67+
68+
<!-- Create the 2 children that will be a part of the configurable product -->
69+
<createData entity="ApiSimpleOne" stepKey="createConfigFirstChildProduct">
70+
<field key="price">60.00</field>
71+
<requiredEntity createDataKey="createConfigProductAttribute"/>
72+
<requiredEntity createDataKey="getFirstConfigAttributeOption"/>
73+
</createData>
74+
<createData entity="ApiSimpleTwo" stepKey="createConfigSecondChildProduct">
75+
<field key="price">60.00</field>
76+
<requiredEntity createDataKey="createConfigProductAttribute"/>
77+
<requiredEntity createDataKey="getSecondConfigAttributeOption"/>
78+
</createData>
79+
80+
<!-- Assign the two products to the configurable product -->
81+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
82+
<requiredEntity createDataKey="createConfigProduct"/>
83+
<requiredEntity createDataKey="createConfigProductAttribute"/>
84+
<requiredEntity createDataKey="getFirstConfigAttributeOption"/>
85+
<requiredEntity createDataKey="getSecondConfigAttributeOption"/>
86+
</createData>
87+
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddChild">
88+
<requiredEntity createDataKey="createConfigProduct"/>
89+
<requiredEntity createDataKey="createConfigFirstChildProduct"/>
90+
</createData>
91+
<createData entity="ConfigurableProductAddChild" stepKey="createSecondConfigProductAddChild">
92+
<requiredEntity createDataKey="createConfigProduct"/>
93+
<requiredEntity createDataKey="createConfigSecondChildProduct"/>
94+
</createData>
95+
96+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdmin"/>
97+
<!-- Update first simple product -->
98+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openFirstSimpleProductForEdit">
99+
<argument name="productId" value="$createFirstProduct.id$"/>
100+
</actionGroup>
101+
<selectOption selector="{{AdminProductFormSection.customSelectField($createDropdownAttribute.attribute[attribute_code]$)}}"
102+
userInput="$createProductAttributeOptionGreen.option[store_labels][0][label]$" stepKey="setAttributeValueForFirstSimple"/>
103+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstSimpleProduct"/>
104+
<!-- Update second simple product -->
105+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSecondSimpleProductForEdit">
106+
<argument name="productId" value="$createSecondProduct.id$"/>
107+
</actionGroup>
108+
<selectOption selector="{{AdminProductFormSection.customSelectField($createDropdownAttribute.attribute[attribute_code]$)}}"
109+
userInput="$createProductAttributeOptionRed.option[store_labels][0][label]$" stepKey="setAttributeValueForSecondSimple"/>
110+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondSimpleProduct"/>
111+
<!-- Update first child of configurable product -->
112+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openFirstChildProductForEdit">
113+
<argument name="productId" value="$createConfigFirstChildProduct.id$"/>
114+
</actionGroup>
115+
<selectOption selector="{{AdminProductFormSection.customSelectField($createDropdownAttribute.attribute[attribute_code]$)}}"
116+
userInput="$createProductAttributeOptionGreen.option[store_labels][0][label]$" stepKey="setAttributeValueForFirstChildProduct"/>
117+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstChildProduct"/>
118+
<!-- Update second child of configurable product -->
119+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSecondChildProductForEdit">
120+
<argument name="productId" value="$createConfigSecondChildProduct.id$"/>
121+
</actionGroup>
122+
<selectOption selector="{{AdminProductFormSection.customSelectField($createDropdownAttribute.attribute[attribute_code]$)}}"
123+
userInput="$createProductAttributeOptionGreen.option[store_labels][0][label]$" stepKey="setAttributeValueForSecondChildProduct"/>
124+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondChildProduct"/>
125+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
126+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
127+
</before>
128+
<after>
129+
<!-- Delete created data -->
130+
<deleteData createDataKey="createDropdownAttribute" stepKey="deleteDropdownAttribute"/>
131+
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
132+
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>
133+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
134+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
135+
<deleteData createDataKey="createConfigFirstChildProduct" stepKey="deleteConfigFirstChildProduct"/>
136+
<deleteData createDataKey="createConfigSecondChildProduct" stepKey="deleteConfigSecondChildProduct"/>
137+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
138+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
139+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetCatalogRulesGridFilter"/>
140+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
141+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
142+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
143+
</after>
144+
<!-- Create Catalog Price Rule -->
145+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/>
146+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule">
147+
<argument name="groups" value="'NOT LOGGED IN'"/>
148+
</actionGroup>
149+
<actionGroup ref="AdminFillCatalogRuleConditionWithSelectAttributeActionGroup" stepKey="createCatalogPriceRule">
150+
<argument name="condition" value="$createDropdownAttribute.default_frontend_label$"/>
151+
<argument name="conditionValue" value="$createProductAttributeOptionGreen.option[store_labels][0][label]$"/>
152+
</actionGroup>
153+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule">
154+
<argument name="discountAmount" value="{{SimpleCatalogPriceRule.discount_amount}}"/>
155+
</actionGroup>
156+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/>
157+
<!-- Run cron -->
158+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
159+
<argument name="indices" value="catalogrule_rule"/>
160+
</actionGroup>
161+
<!-- Open first simple product page on storefront -->
162+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openFirstSimpleProductPage">
163+
<argument name="productUrlKey" value="$createFirstProduct.custom_attributes[url_key]$"/>
164+
</actionGroup>
165+
<!-- Verify price for simple product with attribute option green=$20 -->
166+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertFirstSimpleProductPrices">
167+
<argument name="productPrice" value="$createFirstProduct.price$"/>
168+
<argument name="productFinalPrice" value="$20.00"/>
169+
</actionGroup>
170+
171+
<!-- Open the configurable product page on storefront -->
172+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openConfigurableProductPage">
173+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
174+
</actionGroup>
175+
<!-- Verify price for configurable product with attribute option green=$30 -->
176+
<selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="option1" stepKey="selectFirstOptionOfConfigProduct"/>
177+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertConfigProductWithFirstOptionPrices">
178+
<argument name="productPrice" value="$createConfigFirstChildProduct.price$"/>
179+
<argument name="productFinalPrice" value="$30.00"/>
180+
</actionGroup>
181+
<!-- Verify price for configurable product with attribute option green=$30 -->
182+
<selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="option2" stepKey="selectSecondOptionOfConfigProduct"/>
183+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertConfigProductWithSecondOptionPrices">
184+
<argument name="productPrice" value="$createConfigSecondChildProduct.price$"/>
185+
<argument name="productFinalPrice" value="$30.00"/>
186+
</actionGroup>
187+
188+
<!-- Open the second simple product page on storefront -->
189+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openSecondSimpleProductPage">
190+
<argument name="productUrlKey" value="$createSecondProduct.custom_attributes[url_key]$"/>
191+
</actionGroup>
192+
<!-- Verify Price for second simple product with specialColor red=$40 -->
193+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertSecondSimpleProductPrices">
194+
<argument name="productPrice" value="$createSecondProduct.price$"/>
195+
<argument name="productFinalPrice" value="$createSecondProduct.price$"/>
196+
</actionGroup>
197+
</test>
198+
</tests>

app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
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="ApplyCatalogPriceRuleByProductAttributeTest">
11+
<test name="ApplyCatalogPriceRuleByProductAttributeTest" deprecated="Use AdminApplyCatalogPriceRuleByProductAttributeTest">
1212
<annotations>
1313
<stories value="Catalog price rule"/>
14-
<title value="Admin should be able to apply the catalog price rule by product attribute"/>
14+
<title value="DEPRECATED. Admin should be able to apply the catalog price rule by product attribute"/>
1515
<description value="Admin should be able to apply the catalog price rule by product attribute"/>
1616
<severity value="CRITICAL"/>
1717
<testCaseId value="MC-148"/>
1818
<group value="CatalogRule"/>
1919
<skip>
20-
<issueId value="MC-22577"/>
20+
<issueId value="DEPRECATED">Use AdminApplyCatalogPriceRuleByProductAttributeTest instead.</issueId>
2121
</skip>
2222
</annotations>
2323
<before>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontCheckIsCartUpdatedAfterProductDeleteTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Delete Products from Shopping Cart"/>
14+
<title value="Remove product added to shopping cart"/>
15+
<description value="The product has to be deleted from shopping cart if it deleted in admin panel"/>
16+
<testCaseId value="MC-36299"/>
17+
<useCaseId value="MAGETWO-83169"/>
18+
<severity value="CRITICAL"/>
19+
<group value="checkout"/>
20+
<group value="catalog"/>
21+
</annotations>
22+
<before>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="SimpleProduct2" stepKey="createFirstProduct">
25+
<field key="price">10.00</field>
26+
</createData>
27+
<createData entity="SimpleProduct2" stepKey="createSecondProduct">
28+
<field key="price">20.00</field>
29+
</createData>
30+
</before>
31+
<after>
32+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
33+
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>
34+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
36+
</after>
37+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront">
38+
<argument name="Customer" value="$createCustomer$"/>
39+
</actionGroup>
40+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addFirstProductToCart">
41+
<argument name="product" value="$createFirstProduct$"/>
42+
</actionGroup>
43+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondProductToCart">
44+
<argument name="product" value="$createSecondProduct$"/>
45+
</actionGroup>
46+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/>
47+
<actionGroup ref="AssertStorefrontShoppingCartSummaryItemsActionGroup" stepKey="assertCartTotals">
48+
<argument name="subtotal" value="$30.00"/>
49+
<argument name="total" value="$40.00"/>
50+
</actionGroup>
51+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
52+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstProduct">
53+
<argument name="sku" value="$createFirstProduct.sku$"/>
54+
</actionGroup>
55+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCartPage"/>
56+
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertCartAfterProductDeleted">
57+
<argument name="productName" value="$createSecondProduct.name$"/>
58+
<argument name="productSku" value="$createSecondProduct.sku$"/>
59+
<argument name="productPrice" value="$createSecondProduct.price$"/>
60+
<argument name="subtotal" value="$createSecondProduct.price$" />
61+
<argument name="qty" value="1"/>
62+
</actionGroup>
63+
<dontSee selector="{{CheckoutCartProductSection.productName}}" userInput="$createFirstProduct.name$" stepKey="checkFirstProductIsAbsentInCart"/>
64+
</test>
65+
</tests>

0 commit comments

Comments
 (0)