Skip to content

Commit

Permalink
ENGCOM-8602: [MFTF] Refactoring AdminMassOrdersUpdateCancelPendingOrd…
Browse files Browse the repository at this point in the history
…erTest #31512
  • Loading branch information
gabrieldagama authored Feb 4, 2021
2 parents 1860ee5 + 44abb0d commit 771b42a
Showing 1 changed file with 19 additions and 17 deletions.
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>

0 comments on commit 771b42a

Please sign in to comment.