Skip to content

Commit 1895c7e

Browse files
Merge branch '2.4-develop' into Hammer-Plateform-Health-05Nov24
2 parents 3972d37 + c1677a3 commit 1895c7e

File tree

42 files changed

+1054
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1054
-64
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="StorefrontVerifyDiscountOnDynamicBundleProductDifferentCartRulesTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Discount on dynamic bundle products with different Cart Rules"/>
15+
<title value="Verify dynamic bundle product prices with different Cart Rules on storefront"/>
16+
<description value="Verify discount on dynamic-priced Bundle Product when associated Products are assigned to Categories with different Cart Rules"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4709"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleSubCategory" stepKey="createFirstCategory"/>
22+
<createData entity="SimpleSubCategory" stepKey="createSecondCategory"/>
23+
<!--Create two simple product-->
24+
<createData entity="ApiSimpleProduct" stepKey="simpleProduct1">
25+
<requiredEntity createDataKey="createFirstCategory"/>
26+
<field key="price">99.99</field>
27+
</createData>
28+
<createData entity="ApiSimpleProduct" stepKey="simpleProduct2">
29+
<requiredEntity createDataKey="createSecondCategory"/>
30+
<field key="price">34.49</field>
31+
</createData>
32+
<!--Create Bundle product-->
33+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
34+
<requiredEntity createDataKey="createFirstCategory"/>
35+
</createData>
36+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1">
37+
<requiredEntity createDataKey="createBundleProduct"/>
38+
<field key="required">true</field>
39+
</createData>
40+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
41+
<requiredEntity createDataKey="createBundleProduct"/>
42+
<requiredEntity createDataKey="createBundleOption1"/>
43+
<requiredEntity createDataKey="simpleProduct1"/>
44+
</createData>
45+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
46+
<requiredEntity createDataKey="createBundleProduct"/>
47+
<requiredEntity createDataKey="createBundleOption1"/>
48+
<requiredEntity createDataKey="simpleProduct2"/>
49+
</createData>
50+
</before>
51+
<after>
52+
<deleteData createDataKey="createFirstCategory" stepKey="deleteFirstCategory"/>
53+
<deleteData createDataKey="createSecondCategory" stepKey="deleteSecondCategory"/>
54+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
55+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
56+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
57+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule">
58+
<argument name="ruleName" value="{{CustomSalesRuleWithNoCouponCode.name}}"/>
59+
</actionGroup>
60+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
61+
</after>
62+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
63+
<!-- Create cart price rule -->
64+
<actionGroup ref="AdminCreateCartPriceRuleActionGroup" stepKey="createCartPriceRule">
65+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode"/>
66+
</actionGroup>
67+
<!-- Search and go to cart price rule page -->
68+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="filterCreatedCartPriceRule">
69+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode.name"/>
70+
</actionGroup>
71+
<actionGroup ref="AdminCreateCustomConditionInCartPriceRuleActionGroup" stepKey="createCustomCondition"/>
72+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="saveAndAssertCartPriceRuleSuccessSaveMessage"/>
73+
<!-- Open Bundle Product page on storefront-->
74+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openBundleProductPage">
75+
<argument name="productUrl" value="$createBundleProduct.custom_attributes[url_key]$"/>
76+
</actionGroup>
77+
<!-- Click on customize And Add To Cart Button -->
78+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddToCartButton"/>
79+
<!-- Select Two Products, enter the quantity and add product to the cart -->
80+
<selectOption selector="{{StorefrontBundledSection.multiSelectOption}}" parameterArray="[$$simpleProduct1.name$$ +$99.99, $$simpleProduct2.name$$ +$34.49]" stepKey="selectOptions"/>
81+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
82+
<argument name="quantity" value="1"/>
83+
</actionGroup>
84+
<!-- Go to shopping cart page -->
85+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
86+
<actionGroup ref="AssertStorefrontCartDiscountActionGroup" stepKey="seeDiscountTotal">
87+
<argument name="discount" value="13.45"/>
88+
</actionGroup>
89+
<!-- Search and go to cart price rule page and remove condition-->
90+
<actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="goToCartPriceRulePage"/>
91+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="filterCartPriceRule">
92+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode.name"/>
93+
</actionGroup>
94+
<scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToConditionsHeader"/>
95+
<conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" visible="true" stepKey="clickToExpandConditions"/>
96+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.removeCondition('1--1')}}" stepKey="waitForRemoveToBeClickable"/>
97+
<click selector="{{AdminCartPriceRulesFormSection.removeCondition('1--1')}}" stepKey="removeCondition"/>
98+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="saveCartPriceRuleSuccessSaveMessage"/>
99+
<!-- Go to shopping cart page -->
100+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCartPage"/>
101+
<actionGroup ref="AssertStorefrontCartDiscountActionGroup" stepKey="checkDiscount">
102+
<argument name="discount" value="13.45"/>
103+
</actionGroup>
104+
<!-- Assign category 1 to simple product 2 and unAssign category2 -->
105+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="OpenSimpleProductPage">
106+
<argument name="productId" value="$$simpleProduct2.id$$"/>
107+
</actionGroup>
108+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
109+
<actionGroup ref="AdminUnassignCategoryOnProductAndSaveActionGroup" stepKey="unAssignCategoryTwo">
110+
<argument name="categoryName" value="$$createSecondCategory.name$$"/>
111+
</actionGroup>
112+
<createData entity="AssignProductToCategory" stepKey="assignCategoryOne">
113+
<requiredEntity createDataKey="createFirstCategory"/>
114+
<requiredEntity createDataKey="simpleProduct2"/>
115+
</createData>
116+
<!-- Search and go to cart price rule page and add condition in action tab -->
117+
<actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="againOpenCartPriceRulePage"/>
118+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="againFilterCartPriceRule">
119+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode.name"/>
120+
</actionGroup>
121+
<actionGroup ref="AdminCreateCustomConditionInActionTabInCartPriceRuleActionGroup" stepKey="createConditionInActionsTab"/>
122+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="saveCartPriceRule"/>
123+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
124+
<argument name="indices" value="catalogsearch_fulltext catalog_category_product catalog_product_price catalogrule_rule"/>
125+
</actionGroup>
126+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
127+
<argument name="tags" value="config full_page"/>
128+
</actionGroup>
129+
<!-- Go to shopping cart page -->
130+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="againGoToShoppingCartPage"/>
131+
<waitForElementNotVisible selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="discountIsNotApplied"/>
132+
</test>
133+
</tests>

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -325,6 +325,19 @@
325325
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
326326
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
327327
</entity>
328+
<entity name="ApiSimpleOne1" type="product2">
329+
<data key="name" unique="suffix">Api Simple Product</data>
330+
<data key="sku" unique="suffix">api-simple-product</data>
331+
<data key="urlKey" unique="suffix">api-simple-product</data>
332+
<data key="type_id">simple</data>
333+
<data key="attribute_set_id">4</data>
334+
<data key="visibility">4</data>
335+
<data key="price">1</data>
336+
<data key="status">1</data>
337+
<data key="quantity">1</data>
338+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
339+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
340+
</entity>
328341
<entity name="ApiSimpleProductWithCategory" type="product2" extends="ApiSimpleOne">
329342
<requiredEntity type="custom_attribute">CustomAttributeCategoryIds</requiredEntity>
330343
</entity>
@@ -357,6 +370,19 @@
357370
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
358371
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
359372
</entity>
373+
<entity name="ApiSimpleTwo1" type="product2">
374+
<data key="name" unique="suffix">Api Simple Product Two</data>
375+
<data key="sku" unique="suffix">api-simple-product-two</data>
376+
<data key="urlKey" unique="suffix">api-simple-product-two</data>
377+
<data key="type_id">simple</data>
378+
<data key="attribute_set_id">4</data>
379+
<data key="visibility">4</data>
380+
<data key="price">1</data>
381+
<data key="status">1</data>
382+
<data key="quantity">1</data>
383+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
384+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
385+
</entity>
360386
<entity name="ApiSimpleProductWithPrice50" type="product2" extends="ApiSimpleOne">
361387
<data key="price">50</data>
362388
</entity>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckCustomOptionPriceDifferentCurrencyTest.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
/**
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
6+
* Copyright 2024 Adobe
7+
* All Rights Reserved.
68
*/
79
-->
810
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -50,6 +52,12 @@
5052
</actionGroup>
5153
<actionGroup ref="AssertStorefrontCustomOptionCheckboxByPriceActionGroup" stepKey="checkPriceProductOptionUSD">
5254
<argument name="price" value="12.3"/>
55+
</actionGroup>
56+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexConfig">
57+
<argument name="indices" value=""/>
58+
</actionGroup>
59+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
60+
<argument name="tags" value="config full_page"/>
5361
</actionGroup>
5462
<actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchEURCurrency">
5563
<argument name="currency" value="EUR"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminFillTermsAndConditionsCustomStoreViewActionGroup" extends="AdminTermsConditionsFillTermEditFormActionGroup">
12+
<arguments>
13+
<argument name="storeView" type="string" defaultValue="customStoreEN.name"/>
14+
</arguments>
15+
16+
<remove keyForRemoval="selectOptionStoreView"/>
17+
<selectOption selector="{{AdminNewTermFormSection.storeView}}" userInput="{{storeView}}" stepKey="selectOptionStoreView" />
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="StorefrontTermInCheckoutAndPlaceOrderActionGroup">
12+
<arguments>
13+
<argument name="termCheckboxText" type="string"/>
14+
</arguments>
15+
<!--Check if agreement is present on checkout and select it-->
16+
<scrollTo selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBlock}}" stepKey="scrollToCheckoutAgreementBlock"/>
17+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBlock}}" stepKey="waitForCheckoutAgreementBlockToBeClickable"/>
18+
<click selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBlock}}" stepKey="clickCheckoutAgreementBlock"/>
19+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="waitForCheckAgreementToBeClickable"/>
20+
<selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckboxInput}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/>
21+
<!--Checkout select Check/Money Order payment-->
22+
<waitForPageLoad stepKey="waitForPageLoad"/>
23+
<waitForElementClickable selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButtonClickable"/>
24+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
25+
<waitForPageLoad stepKey="waitForOrderPlaced"/>
26+
</actionGroup>
27+
</actionGroups>

app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -53,6 +53,14 @@
5353
<data key="checkboxText" unique="suffix">test_checkbox</data>
5454
<data key="content" unique="suffix">TestMessage</data>
5555
</entity>
56+
<entity name="enableTextTerm" type="term">
57+
<data key="name">Test Condition</data>
58+
<data key="isActive">Enabled</data>
59+
<data key="isHtml">Text</data>
60+
<data key="mode">Manually</data>
61+
<data key="checkboxText">Terms and Conditions</data>
62+
<data key="content">terms text</data>
63+
</entity>
5664
<entity name="enableTermsAndConditions" type="term">
5765
<data key="path">checkout/options/enable_agreements</data>
5866
<data key="value">1</data>

app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCheckoutAgreementsSection">
12+
<element name="checkoutAgreementCheckboxInput" type="checkbox" selector="input#agreement_checkmo_3.required-entry"/>
13+
<element name="checkoutAgreementBlock" type="checkbox" selector=".checkout-agreements-block"/>
1214
<element name="checkoutAgreementCheckbox" type="checkbox" selector="div.checkout-agreement.field.choice.required > input"/>
1315
<element name="checkoutAgreementButton" type="button" selector="div.checkout-agreements-block > div > div > div > label > button > span"/>
1416
<element name="checkoutAgreementErrorMessage" type="button" selector="div.checkout-agreement.field.choice.required > div.mage-error"/>

0 commit comments

Comments
 (0)