Skip to content

Commit 96427ad

Browse files
Merge branch 'ACQE-8932' into ACQE-functional-deployment-v4-6
2 parents 3662a1c + 4c6cf4f commit 96427ad

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 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="AdminCreateCartPriceRuleWithProductSubselectionActionGroup" extends="AdminCreateCartPriceRuleActionGroup">
12+
<annotations>
13+
<description>Create a complete cart price rule with product subselection quantity condition and save it.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="condition1" type="string" defaultValue="Products subselection"/>
17+
<argument name="ruleToChange1" type="string" defaultValue="is"/>
18+
<argument name="rule1" type="string" defaultValue="equals or greater than"/>
19+
<argument name="ruleToChange2" type="string" defaultValue="..."/>
20+
<argument name="rule2" type="string" defaultValue="1"/>
21+
</arguments>
22+
<!--Go to Conditions section-->
23+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="waitForOpenConditionsSection" after="selectActionType"/>
24+
<click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="waitForOpenConditionsSection"/>
25+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="waitForAddFirstCondition" after="openConditionsSection"/>
26+
<click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="waitForAddFirstCondition"/>
27+
<selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/>
28+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/>
29+
<click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/>
30+
<selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/>
31+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/>
32+
<click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/>
33+
<fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/>
34+
</actionGroup>
35+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 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="StorefrontAssertDiscountAmountOnPaymentPageActionGroup">
12+
<annotations>
13+
<description>In storefront product page assert cart price discount is applied</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="discountPrice" type="string"/>
17+
</arguments>
18+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/>
19+
<grabTextFrom selector="{{CheckoutPaymentSection.discountPrice}}" stepKey="grabDiscountPrice"/>
20+
<assertEquals stepKey="checkRewardPoints">
21+
<expectedResult type="string">{{discountPrice}}</expectedResult>
22+
<actualResult type="string">{$grabDiscountPrice}</actualResult>
23+
</assertEquals>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 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="AdminVerifySalesRuleProductSubselectionWithQuantityConditionTest">
12+
<annotations>
13+
<features value="SalesRule"/>
14+
<stories value="Cart price rule with product subselection"/>
15+
<title value="Verify cart price rule with product subselection quantity condition applies discount"/>
16+
<description value="Verify that cart price rule with product subselection condition Qty >= 1 successfully applies discount at checkout"/>
17+
<severity value="MINOR"/>
18+
<testCaseId value="AC-15273"/>
19+
<group value="salesRule"/>
20+
</annotations>
21+
<before>
22+
<!-- Admin login -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<createData entity="_defaultProduct" stepKey="createSimpleProduct"/>
25+
</before>
26+
<after>
27+
<!-- Delete created cart price rule -->
28+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule">
29+
<argument name="ruleName" value="{{TestSalesRule.name}}"/>
30+
</actionGroup>
31+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/>
32+
<!-- Delete created product -->
33+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
34+
<!-- Admin logout -->
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
36+
</after>
37+
<!-- Step 1-2: Create cart price rule with product subselection (Qty >= 1) -->
38+
<actionGroup ref="AdminCreateCartPriceRuleWithProductSubselectionActionGroup" stepKey="createRule">
39+
<argument name="ruleName" value="TestSalesRule"/>
40+
</actionGroup>
41+
<!-- Step 3: Run cron job -->
42+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronReindex">
43+
<argument name="indices" value=""/>
44+
</actionGroup>
45+
<!-- Step 4: Navigate to storefront and add product to cart -->
46+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
47+
<!-- Open product page -->
48+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
49+
<argument name="productUrl" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
50+
</actionGroup>
51+
<!-- Add product to cart -->
52+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
53+
<argument name="product" value="$$createSimpleProduct$$"/>
54+
<argument name="productCount" value="1"/>
55+
</actionGroup>
56+
<!-- Go to shopping cart page and assert discount was successfully applied -->
57+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
58+
<actionGroup ref="AssertStorefrontCartDiscountActionGroup" stepKey="seeDiscountTotal">
59+
<argument name="discount" value="61.50"/>
60+
</actionGroup>
61+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
62+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
63+
<argument name="customerVar" value="CustomerEntityOne" />
64+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
65+
</actionGroup>
66+
<!-- Step 5: Verify discount was successfully applied -->
67+
<actionGroup ref="StorefrontAssertDiscountAmountOnPaymentPageActionGroup" stepKey="verifyDiscountFirstTime">
68+
<argument name="discountPrice" value="-$61.50" />
69+
</actionGroup>
70+
</test>
71+
</tests>

0 commit comments

Comments
 (0)