Skip to content

Commit e3b0a0b

Browse files
ENGCOM-8606: [MFTF] Refactoring AdminCheckingCreditMemoTotalsTest #31394
- Merge Pull Request #31394 from AnnaAPak/magento2:ref-AdminCheckingCreditMemoUpdateTotalsTest - Merged commits: 1. cfa15e1
2 parents 63434d2 + cfa15e1 commit e3b0a0b

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml

+34-17
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,61 @@
2020
<group value="sales"/>
2121
</annotations>
2222
<before>
23-
<!--Create product-->
2423
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
25-
<!--Create customer-->
24+
2625
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
27-
<!--Login to admin page-->
26+
27+
<createData entity="CustomerCart" stepKey="createCustomerCart">
28+
<requiredEntity createDataKey="createCustomer"/>
29+
</createData>
30+
31+
<createData entity="CustomerCartItem" stepKey="addCartItem">
32+
<requiredEntity createDataKey="createCustomerCart"/>
33+
<requiredEntity createDataKey="createSimpleProduct"/>
34+
</createData>
35+
36+
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
37+
<requiredEntity createDataKey="createCustomerCart"/>
38+
</createData>
39+
40+
<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation">
41+
<requiredEntity createDataKey="createCustomerCart"/>
42+
</updateData>
43+
44+
<createData entity="Invoice" stepKey="invoiceOrderOne">
45+
<requiredEntity createDataKey="createCustomerCart"/>
46+
</createData>
47+
2848
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2949
</before>
3050
<after>
31-
<!--Delete simple product-->
3251
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
33-
<!--Delete customer-->
3452
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3553
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3654
</after>
3755

38-
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
39-
<argument name="product" value="$$createSimpleProduct$$"/>
40-
<argument name="customer" value="$$createCustomer$$"/>
56+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/>
57+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabOrderId"/>
58+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/>
59+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="submitInvoice"/>
60+
61+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/>
62+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
63+
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="getOrderId"/>
64+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById">
65+
<argument name="orderId" value="{$getOrderId}"/>
4166
</actionGroup>
42-
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
43-
<!--Create invoice-->
44-
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/>
45-
<!--Submit invoice-->
46-
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/>
4767

48-
<!--Create Credit Memo-->
4968
<actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo">
50-
<argument name="orderId" value="{$grabOrderId}"/>
69+
<argument name="orderId" value="{$getOrderId}"/>
5170
</actionGroup>
5271
<fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/>
5372
<actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateCreditMemoTotals"/>
5473
<actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/>
5574

56-
<!--Go to Credit Memo tab-->
5775
<click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemosTab"/>
5876
<waitForPageLoad stepKey="waitForCreditMemosGridToLoad"/>
5977

60-
<!--Check refunded total -->
6178
<see selector="{{AdminOrderCreditMemosTabSection.gridRow('1')}}" userInput="$123" stepKey="seeCreditMemoInGrid"/>
6279
</test>
6380
</tests>

0 commit comments

Comments
 (0)