|
22 | 22 | <before> |
23 | 23 | <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
24 | 24 |
|
25 | | - <!-- Enable Cash On Delivery payment method --> |
26 | 25 | <magentoCLI command="config:set {{EnableCashOnDeliveryConfigData.path}} {{EnableCashOnDeliveryConfigData.value}}" stepKey="enableCashOnDeliveryPayment"/> |
27 | | - |
28 | | - <!--Set default flat rate shipping method settings--> |
29 | 26 | <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
30 | 27 |
|
31 | | - <!--Create simple customer--> |
32 | 28 | <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> |
33 | 29 |
|
34 | | - <!-- Create Simple Product --> |
35 | 30 | <createData entity="SimpleProduct2" stepKey="simpleProduct"> |
36 | 31 | <field key="price">10.00</field> |
37 | 32 | </createData> |
| 33 | + |
| 34 | + <createData entity="CustomerCart" stepKey="createCustomerCart"> |
| 35 | + <requiredEntity createDataKey="simpleCustomer"/> |
| 36 | + </createData> |
| 37 | + <createData entity="CustomerCartItem" stepKey="addCartItem"> |
| 38 | + <requiredEntity createDataKey="createCustomerCart"/> |
| 39 | + <requiredEntity createDataKey="simpleProduct"/> |
| 40 | + </createData> |
| 41 | + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> |
| 42 | + <requiredEntity createDataKey="createCustomerCart"/> |
| 43 | + </createData> |
38 | 44 | </before> |
39 | 45 | <after> |
40 | 46 | <magentoCLI command="config:set {{DisableCashOnDeliveryConfigData.path}} {{DisableCashOnDeliveryConfigData.value}}" stepKey="disableCashOnDeliveryPayment"/> |
|
43 | 49 | <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
44 | 50 | </after> |
45 | 51 |
|
46 | | - <!-- Create new customer order --> |
47 | | - <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> |
48 | | - <argument name="customer" value="$$simpleCustomer$$"/> |
49 | | - </actionGroup> |
| 52 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="navigateToNewOrderWithExistingCustomer"/> |
| 53 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addSimpleProductToTheOrder"/> |
| 54 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFlatRateShippingMethod"/> |
| 55 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPaymentOptions"/> |
| 56 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCashOnDeliveryPaymentOption"/> |
50 | 57 |
|
51 | | - <!-- Add Simple product to order --> |
52 | | - <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> |
53 | | - <argument name="product" value="$$simpleProduct$$"/> |
54 | | - </actionGroup> |
55 | | - |
56 | | - <!-- Select FlatRate shipping method --> |
57 | | - <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> |
| 58 | + <updateData createDataKey="createCustomerCart" entity="CashOnDeliveryOrderPaymentMethod" stepKey="submitOrder"> |
| 59 | + <requiredEntity createDataKey="createCustomerCart"/> |
| 60 | + </updateData> |
58 | 61 |
|
59 | | - <!-- Select Cash On Delivery payment method --> |
60 | | - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> |
61 | | - <checkOption selector="{{AdminOrderFormPaymentSection.cashOnDeliveryOption}}" stepKey="selectCashOnDeliveryPaymentOption"/> |
62 | | - <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder" /> |
| 62 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="verifyCreatedOrderInformation"/> |
| 63 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderId"/> |
63 | 64 |
|
64 | | - <!--Verify order information--> |
65 | | - <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> |
66 | | - <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> |
| 65 | + <actionGroup ref="AdminOpenOrderViewPageByOrderIdActionGroup" stepKey="openOrder"> |
| 66 | + <argument name="orderId" value="$createCustomerCart.return$"/> |
| 67 | + </actionGroup> |
67 | 68 |
|
68 | | - <!-- Cancel the Order --> |
69 | 69 | <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> |
70 | | - |
71 | | - <!--Log in to Storefront as Customer --> |
| 70 | + |
72 | 71 | <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> |
73 | 72 | <argument name="Customer" value="$$simpleCustomer$$"/> |
74 | 73 | </actionGroup> |
75 | | - |
76 | | - <!-- Assert Order status in frontend grid --> |
77 | | - <click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('My Orders')}}" stepKey="clickOnMyOrders"/> |
78 | | - <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> |
79 | | - <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> |
| 74 | + |
| 75 | + <getData entity="GetOrderData" stepKey="getOrderData"> |
| 76 | + <requiredEntity createDataKey="createCustomerCart"/> |
| 77 | + </getData> |
| 78 | + <actionGroup ref="StorefrontOpenMyOrdersPageActionGroup" stepKey="clickOnMyOrders"/> |
| 79 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderDetailsToLoad"/> |
| 80 | + <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$getOrderData.increment_id$', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> |
80 | 81 | </test> |
81 | 82 | </tests> |
0 commit comments