Skip to content

Commit c4e0af8

Browse files
committed
MFTF Stability control
- update AdminCheckZeroSubtotalOrderWithCustomStatus test so that it make sense at all
1 parent edec1b1 commit c4e0af8

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontShippmentFromActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!--Fill shipment form for free shipping-->
12-
<actionGroup name="ShipmentFormFreeShippingActionGroup">
12+
<actionGroup name="ShipmentFormFreeShippingActionGroup" deprecated="This action group must not be used because it violated Technical guidelines on how to write tests.">
1313
<annotations>
1414
<description>Fills in the Customer details for the 'Shipping Address' section of the Storefront Checkout page. Selects 'Free Shipping'. Clicks on Next. Validates that the URL is present and correct.</description>
1515
</annotations>
1616

17+
<!-- [DO NOT USE!] This action group must not be used because it violated Technical guidelines on how to write tests. -->
18+
1719
<fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="{{CustomerEntityOne.email}}" stepKey="setCustomerEmail"/>
1820
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="SetCustomerFirstName"/>
1921
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="SetCustomerLastName"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CheckoutShippingMethodsSection">
12+
<element name="shippingMethodSelectorNextButton" selector="#checkout-step-shipping_method button.button.action.continue.primary" type="button" timeout="30" />
1213
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
1314
<element name="firstShippingMethod" type="radio" selector="//*[@id='checkout-shipping-method-load']//input[@class='radio']"/>
1415
<element name="shippingMethodRow" type="text" selector=".form.methods-shipping table tbody tr"/>

app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckZeroSubtotalOrderWithCustomStatus.xml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,26 @@
2424
<createData entity="SimpleProduct" stepKey="simpleproduct">
2525
<requiredEntity createDataKey="simplecategory"/>
2626
</createData>
27-
<createData entity="PaymentMethodsSettingConfig" stepKey="paymentMethodsSettingConfig"/>
28-
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/>
29-
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
30-
<argument name="tags" value="config full_page"/>
31-
</actionGroup>
32-
3327
<createData entity="ApiSalesRule" stepKey="createCartPriceRule">
3428
<field key="discount_amount">100</field>
3529
</createData>
3630
<createData entity="ApiSalesRuleCoupon" stepKey="createCartPriceRuleCoupon">
3731
<requiredEntity createDataKey="createCartPriceRule"/>
3832
</createData>
3933

34+
<actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="freeShippingMethodsSettingConfig"/>
4035
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
36+
37+
<!-- To be removed when BI Changes are allowed -->
38+
<comment userInput="Preserve BIC. PaymentMethodsSettingConfig" stepKey="paymentMethodsSettingConfig"/>
39+
<comment userInput="Preserve BIC. CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches" />
4140
</before>
4241

4342
<after>
43+
<magentoCLI command="config:set {{EnableFreeOrderStatusPending.path}} {{EnableFreeOrderStatusPending.value}}" stepKey="disablePaymentMethodsSettingConfig"/>
44+
<actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShippingConfig"/>
4445
<deleteData createDataKey="simplecategory" stepKey="deleteCategory"/>
4546
<deleteData createDataKey="simpleproduct" stepKey="deleteProduct"/>
46-
<createData entity="DisablePaymentMethodsSettingConfig" stepKey="disablePaymentMethodsSettingConfig"/>
47-
<createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/>
48-
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
4947
<deleteData createDataKey="createCartPriceRule" stepKey="deleteSalesRule"/>
5048
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
5149
<argument name="indices" value=""/>
@@ -54,6 +52,8 @@
5452
<argument name="tags" value="config full_page"/>
5553
</actionGroup>
5654
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
55+
<!-- To be removed when BI Changes are allowed -->
56+
<comment userInput="Preserving BIC. DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/>
5757
</after>
5858

5959
<!-- Go to new order status page -->
@@ -75,16 +75,18 @@
7575

7676
<!-- Assign status to state -->
7777
<click selector="{{AdminOrderStatusGridSection.assignStatusToStateBtn}}" stepKey="clickAssignStatusBtn"/>
78-
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderStatus}}" userInput="{{EnableFreeOrderStatusCustom.value}}" stepKey="selectOrderStatus"/>
78+
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderStatus}}" userInput="{{defaultOrderStatus.label}}" stepKey="selectOrderStatus"/>
7979
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderState}}" userInput="{{OrderState.new}}" stepKey="selectOrderState"/>
8080
<checkOption selector="{{AdminAssignOrderStatusToStateSection.orderStatusAsDefault}}" stepKey="orderStatusAsDefault"/>
8181
<uncheckOption selector="{{AdminAssignOrderStatusToStateSection.visibleOnStorefront}}" stepKey="visibleOnStorefront"/>
8282
<click selector="{{AdminAssignOrderStatusToStateSection.saveStatusAssignment}}" stepKey="clickSaveStatus"/>
83-
<see selector="{{AdminMessagesSection.success}}" userInput="You assigned the order status." stepKey="seeSuccess"/>
83+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccess">
84+
<argument name="message" value="You assigned the order status." />
85+
</actionGroup>
8486

8587
<!-- Prepare data for constraints -->
86-
<magentoCLI command="config:set {{EnableFreeOrderStatusCustom.path}} {{EnableFreeOrderStatusCustom.value}}" stepKey="enableNewOrderStatus"/>
87-
<magentoCLI command="config:set {{EnableFreeOrderPaymentAction.path}} {{EnableFreeOrderPaymentAction.value}}" stepKey="enableNewOrderPaymentAction"/>
88+
<magentoCLI command="config:set {{EnableFreeOrderStatusCustom.path}} {{defaultOrderStatus.status}}" stepKey="enableNewOrderStatus"/>
89+
<comment userInput="Preserve BIC. config:set {{EnableFreeOrderPaymentAction.path}} {{EnableFreeOrderPaymentAction.value}}" stepKey="enableNewOrderPaymentAction"/>
8890
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
8991
<argument name="tags" value="config full_page"/>
9092
</actionGroup>
@@ -94,7 +96,8 @@
9496
<argument name="product" value="$$simpleproduct$$"/>
9597
</actionGroup>
9698

97-
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="clickToProceedToCheckout"/>
99+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="clickToProceedToCheckout"/>
100+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodSelectorNextButton}}" stepKey="waitForNextButtonVisible" />
98101

99102
<actionGroup ref="ShipmentFormFreeShippingActionGroup" stepKey="shipmentFormFreeShippingActionGroup"/>
100103

@@ -121,8 +124,11 @@
121124
<argument name="orderId" value="{$grabOrderNumber}"/>
122125
</actionGroup>
123126

124-
<!-- Assert invoice button -->
125-
<seeElement selector="{{AdminOrderDetailsMainActionsSection.invoiceBtn}}" stepKey="seeInvoiceBtn"/>
127+
<!-- Assert Order Status on Order view page -->
128+
<comment userInput="Preserve BIC. {{AdminOrderDetailsMainActionsSection.invoiceBtn}}" stepKey="seeInvoiceBtn"/>
129+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="verifyOrderStatusOnOrderViewPage">
130+
<argument name="status" value="{{defaultOrderStatus.label}}" />
131+
</actionGroup>
126132

127133
</test>
128134
</tests>

0 commit comments

Comments
 (0)