Skip to content

Commit 4c6cf4f

Browse files
committed
ACQE-8932:Verify cart price rule with product subselection quantity condition applies discount
- Changes done on test file and action group as per latest comments
1 parent c9e57f7 commit 4c6cf4f

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithProductSubselectionActionGroup.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
* All Rights Reserved.
66
*/
77
-->
8+
89
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1011
<actionGroup name="AdminCreateCartPriceRuleWithProductSubselectionActionGroup" extends="AdminCreateCartPriceRuleActionGroup">
1112
<annotations>
1213
<description>Create a complete cart price rule with product subselection quantity condition and save it.</description>
@@ -16,16 +17,18 @@
1617
<argument name="ruleToChange1" type="string" defaultValue="is"/>
1718
<argument name="rule1" type="string" defaultValue="equals or greater than"/>
1819
<argument name="ruleToChange2" type="string" defaultValue="..."/>
19-
<argument name="rule2" type="string" defaultValue="2"/>
20+
<argument name="rule2" type="string" defaultValue="1"/>
2021
</arguments>
2122
<!--Go to Conditions section-->
22-
<click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/>
23-
<click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/>
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"/>
2427
<selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/>
25-
<waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/>
28+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/>
2629
<click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/>
2730
<selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/>
28-
<waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/>
31+
<waitForElementClickable selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/>
2932
<click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/>
3033
<fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/>
3134
</actionGroup>

app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontAssertDiscountAmountOnPaymentPageActionGroup.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
* All Rights Reserved.
66
*/
77
-->
8+
89
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1011
<actionGroup name="StorefrontAssertDiscountAmountOnPaymentPageActionGroup">
12+
<annotations>
13+
<description>In storefront product page assert cart price discount is applied</description>
14+
</annotations>
1115
<arguments>
1216
<argument name="discountPrice" type="string"/>
1317
</arguments>
14-
15-
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/>
18+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/>
1619
<grabTextFrom selector="{{CheckoutPaymentSection.discountPrice}}" stepKey="grabDiscountPrice"/>
1720
<assertEquals stepKey="checkRewardPoints">
1821
<expectedResult type="string">{{discountPrice}}</expectedResult>
1922
<actualResult type="string">{$grabDiscountPrice}</actualResult>
2023
</assertEquals>
21-
2224
</actionGroup>
2325
</actionGroups>

app/code/Magento/SalesRule/Test/Mftf/Test/AdminVerifySalesRuleProductSubselectionWithQuantityConditionTest.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
<test name="AdminVerifySalesRuleProductSubselectionWithQuantityConditionTest">
1212
<annotations>
1313
<features value="SalesRule"/>
14-
<stories value="Cart Price Rule with Product Subselection"/>
14+
<stories value="Cart price rule with product subselection"/>
1515
<title value="Verify cart price rule with product subselection quantity condition applies discount"/>
1616
<description value="Verify that cart price rule with product subselection condition Qty >= 1 successfully applies discount at checkout"/>
17-
<severity value="CRITICAL"/>
17+
<severity value="MINOR"/>
1818
<testCaseId value="AC-15273"/>
1919
<group value="salesRule"/>
2020
</annotations>
2121
<before>
22-
<!-- Admin Login -->
22+
<!-- Admin login -->
2323
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2424
<createData entity="_defaultProduct" stepKey="createSimpleProduct"/>
2525
</before>
@@ -31,17 +31,12 @@
3131
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/>
3232
<!-- Delete created product -->
3333
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
34-
<!-- Admin Logout -->
35-
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
34+
<!-- Admin logout -->
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3636
</after>
3737
<!-- Step 1-2: Create cart price rule with product subselection (Qty >= 1) -->
3838
<actionGroup ref="AdminCreateCartPriceRuleWithProductSubselectionActionGroup" stepKey="createRule">
3939
<argument name="ruleName" value="TestSalesRule"/>
40-
<argument name="condition1" value="Products subselection"/>
41-
<argument name="ruleToChange1" value="is"/>
42-
<argument name="rule1" value="equals or greater than"/>
43-
<argument name="ruleToChange2" value="..."/>
44-
<argument name="rule2" value="1"/>
4540
</actionGroup>
4641
<!-- Step 3: Run cron job -->
4742
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronReindex">
@@ -63,7 +58,7 @@
6358
<actionGroup ref="AssertStorefrontCartDiscountActionGroup" stepKey="seeDiscountTotal">
6459
<argument name="discount" value="61.50"/>
6560
</actionGroup>
66-
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
61+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
6762
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
6863
<argument name="customerVar" value="CustomerEntityOne" />
6964
<argument name="customerAddressVar" value="CustomerAddressSimple" />

0 commit comments

Comments
 (0)