Skip to content

[MFTF] Refactoring AdminMassOrdersUpdateCancelPendingOrderTest #31512

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

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,48 +20,50 @@
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
<!-- Create Data -->
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="defaultSimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
</before>
<after>
<!-- Delete data -->
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<!-- Create order -->
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
<argument name="product" value="$$createProduct$$"/>
<argument name="customer" value="$$createCustomer$$"/>
</actionGroup>
<grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/>
<assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId">
<actualResult type="const">$getOrderId</actualResult>
</assertNotEmpty>
<createData entity="CustomerCart" stepKey="createCustomerCart">
<requiredEntity createDataKey="createCustomer"/>
</createData>
<createData entity="CustomerCartItem" stepKey="addCartItem">
<requiredEntity createDataKey="createCustomerCart"/>
<requiredEntity createDataKey="createProduct"/>
</createData>
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
<requiredEntity createDataKey="createCustomerCart"/>
</createData>
<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="createOrder">
<requiredEntity createDataKey="createCustomerCart"/>
</updateData>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/>

<!-- Navigate to backend: Go to Sales > Orders -->
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/>

<!-- Select Mass Action according to dataset: Cancel -->
<actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="ActionCancel">
<argument name="action" value="Cancel"/>
<argument name="orderId" value="$getOrderId"/>
<argument name="orderId" value="$grabOrderId"/>
</actionGroup>
<see userInput="We canceled 1 order(s)." stepKey="assertOrderCancelMassActionSuccessMessage"/>

<!--Assert orders in orders grid -->
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="filterOrder">
<argument name="orderId" value="{$getOrderId}"/>
<argument name="orderId" value="{$grabOrderId}"/>
<argument name="orderStatus" value="Canceled"/>
</actionGroup>
<see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/>
<see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/>
<see userInput="Canceled" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/>
</test>
</tests>