Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MFTF] Refactoring AdminCheckingCreditMemoTotalsTest #31394

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,61 @@
<group value="sales"/>
</annotations>
<before>
<!--Create product-->
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
<!--Create customer-->

<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
<!--Login to admin page-->

<createData entity="CustomerCart" stepKey="createCustomerCart">
<requiredEntity createDataKey="createCustomer"/>
</createData>

<createData entity="CustomerCartItem" stepKey="addCartItem">
<requiredEntity createDataKey="createCustomerCart"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>

<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
<requiredEntity createDataKey="createCustomerCart"/>
</createData>

<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation">
<requiredEntity createDataKey="createCustomerCart"/>
</updateData>

<createData entity="Invoice" stepKey="invoiceOrderOne">
<requiredEntity createDataKey="createCustomerCart"/>
</createData>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<!--Delete simple product-->
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<!--Delete customer-->
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
<argument name="product" value="$$createSimpleProduct$$"/>
<argument name="customer" value="$$createCustomer$$"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabOrderId"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="submitInvoice"/>

<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="getOrderId"/>
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById">
<argument name="orderId" value="{$getOrderId}"/>
</actionGroup>
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
<!--Create invoice-->
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/>
<!--Submit invoice-->
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/>

<!--Create Credit Memo-->
<actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo">
<argument name="orderId" value="{$grabOrderId}"/>
<argument name="orderId" value="{$getOrderId}"/>
</actionGroup>
<fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/>
<actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateCreditMemoTotals"/>
<actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/>

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

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