|
19 | 19 | </annotations>
|
20 | 20 |
|
21 | 21 | <before>
|
22 |
| - <!--Set default flat rate shipping method settings--> |
23 | 22 | <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
|
24 |
| - |
25 |
| - <!--Create simple customer--> |
26 | 23 | <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
|
27 |
| - |
28 |
| - <!--Create simple product 1--> |
29 | 24 | <createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>
|
30 |
| - |
31 |
| - <!--Create simple product 2--> |
32 | 25 | <createData entity="ApiProductWithDescription" stepKey="simple2" before="product"/>
|
33 |
| - |
34 |
| - <!--Create bundle product with checkbox bundle option--> |
35 | 26 | <createData entity="ApiBundleProduct" stepKey="product"/>
|
36 | 27 | <createData entity="CheckboxOption" stepKey="checkboxBundleOption">
|
37 | 28 | <requiredEntity createDataKey="product"/>
|
38 | 29 | </createData>
|
39 |
| - |
40 |
| - <!--Link simple product 1 to bundle option with default quantity 2--> |
41 | 30 | <createData entity="ApiBundleLink" stepKey="createBundleLink1">
|
42 | 31 | <requiredEntity createDataKey="product"/>
|
43 | 32 | <requiredEntity createDataKey="checkboxBundleOption"/>
|
44 | 33 | <requiredEntity createDataKey="simple1"/>
|
45 | 34 | <field key="qty">2</field>
|
46 | 35 | <field key="is_default">1</field>
|
47 | 36 | </createData>
|
48 |
| - |
49 |
| - <!--Link simple product 2 to bundle option with default quantity 2--> |
50 | 37 | <createData entity="ApiBundleLink" stepKey="createBundleLink2">
|
51 | 38 | <requiredEntity createDataKey="product"/>
|
52 | 39 | <requiredEntity createDataKey="checkboxBundleOption"/>
|
53 | 40 | <requiredEntity createDataKey="simple2"/>
|
54 | 41 | <field key="qty">2</field>
|
55 | 42 | <field key="is_default">1</field>
|
56 | 43 | </createData>
|
57 |
| - |
58 |
| - <!--Add drop-down bundle option--> |
59 | 44 | <createData entity="DropDownBundleOption" stepKey="dropDownBundleOption">
|
60 | 45 | <requiredEntity createDataKey="product"/>
|
61 | 46 | </createData>
|
62 |
| - |
63 |
| - <!--Link simple product 1 to drop-down bundle option with default quantity 2--> |
64 | 47 | <createData entity="ApiBundleLink" stepKey="createBundleLink3">
|
65 | 48 | <requiredEntity createDataKey="product"/>
|
66 | 49 | <requiredEntity createDataKey="dropDownBundleOption"/>
|
67 | 50 | <requiredEntity createDataKey="simple1"/>
|
68 | 51 | <field key="qty">2</field>
|
69 | 52 | <field key="is_default">1</field>
|
70 | 53 | </createData>
|
71 |
| - |
72 |
| - <!--Link simple product 2 to drop-down bundle option with default quantity 2--> |
73 | 54 | <createData entity="ApiBundleLink" stepKey="createBundleLink4">
|
74 | 55 | <requiredEntity createDataKey="product"/>
|
75 | 56 | <requiredEntity createDataKey="dropDownBundleOption"/>
|
|
78 | 59 | </createData>
|
79 | 60 | <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
|
80 | 61 | </before>
|
| 62 | + <after> |
| 63 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 64 | + <deleteData createDataKey="product" stepKey="delete"/> |
| 65 | + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> |
| 66 | + <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> |
| 67 | + <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> |
| 68 | + </after> |
81 | 69 |
|
82 |
| - <!--Create new customer order--> |
83 | 70 | <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
|
84 | 71 | <argument name="customer" value="$$simpleCustomer$$"/>
|
85 | 72 | </actionGroup>
|
86 |
| - |
87 |
| - <!--Add bundle product to order and check product price in grid--> |
88 | 73 | <actionGroup ref="AddBundleProductToOrderAndCheckPriceInGridActionGroup" stepKey="addBundleProductToOrder">
|
89 | 74 | <argument name="product" value="$$product$$"/>
|
90 | 75 | <argument name="quantity" value="1"/>
|
91 | 76 | <argument name="price" value="$738.00"/>
|
92 | 77 | </actionGroup>
|
93 |
| - |
94 |
| - <!--Select FlatRate shipping method--> |
95 | 78 | <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/>
|
96 |
| - |
97 |
| - <!--Submit order--> |
98 |
| - <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> |
99 |
| - |
100 |
| - <!--Verify order information--> |
101 |
| - <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> |
102 |
| - |
103 |
| - |
104 |
| - <!-- Create Invoice --> |
| 79 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
105 | 80 | <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>
|
106 |
| - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> |
107 |
| - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> |
108 |
| - <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> |
109 |
| - |
110 |
| - <!-- Go to Sales > Orders > find out placed order and open --> |
111 |
| - <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> |
112 |
| - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"> |
113 |
| - <actualResult type="const">$grabOrderId</actualResult> |
114 |
| - </assertNotEmpty> |
| 81 | + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> |
| 82 | + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> |
115 | 83 | <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
|
116 |
| - <argument name="orderId" value="{$grabOrderId}"/> |
| 84 | + <argument name="orderId" value="$grabOrderId"/> |
117 | 85 | </actionGroup>
|
118 |
| - |
119 |
| - <!-- Click 'Credit Memo' button and fill data from dataset: partial refund --> |
120 | 86 | <actionGroup ref="AdminOpenAndFillCreditMemoRefundBundleWithQtyActionGroup" stepKey="fillCreditMemoRefund">
|
121 | 87 | <argument name="itemQtyToRefund" value="0"/>
|
122 | 88 | <argument name="rowNumberItemOne" value="3"/>
|
123 | 89 | <argument name="rowNumberItemTwo" value="5"/>
|
124 | 90 | <argument name="rowNumberItemThree" value="6"/>
|
125 | 91 | <argument name="adjustmentRefund" value="10"/>
|
126 | 92 | </actionGroup>
|
| 93 | + <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo" /> |
127 | 94 |
|
128 |
| - <!-- On order's page click 'Refund offline' button --> |
129 |
| - <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/> |
130 |
| - <waitForPageLoad stepKey="waitForResultPage"/> |
131 |
| - |
132 |
| - <!-- Perform all assertions: assert refund success create message --> |
133 |
| - <see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the credit memo." stepKey="assertRefundSuccessCreateMessage"/> |
134 |
| - |
135 |
| - <!--Assert refund in Credit Memo Tab --> |
136 |
| - <click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemoTab"/> |
137 |
| - <waitForPageLoad stepKey="waitForTabLoad"/> |
138 |
| - <grabTextFrom selector="{{AdminCreditMemosGridSection.memoId}}" stepKey="grabMemoId"/> |
139 |
| - <assertNotEmpty stepKey="assertMemoIdIsNotEmpty" after="grabMemoId"> |
140 |
| - <actualResult type="const">$grabMemoId</actualResult> |
141 |
| - </assertNotEmpty> |
142 |
| - <click selector="{{AdminCreditMemosGridSection.memoId}}" stepKey="clickView"/> |
143 |
| - <waitForPageLoad stepKey="waitForCreditMemo"/> |
| 95 | + <actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="openCreditMemo" /> |
144 | 96 | <scrollTo selector="{{AdminCreditMemoViewTotalSection.subtotal}}" stepKey="scrollToTotal"/>
|
145 |
| - <see selector="{{AdminCreditMemoViewTotalSection.subtotal}}" userInput="$0.00" stepKey="seeSubtotal"/> |
146 |
| - <see selector="{{AdminCreditMemoViewTotalSection.adjustmentRefund}}" userInput="$10.00" stepKey="seeAdjustmentRefund"/> |
147 |
| - <see selector="{{AdminCreditMemoViewTotalSection.adjustmentFee}}" userInput="$0.00" stepKey="seeAdjustmentFee"/> |
148 |
| - <see selector="{{AdminCreditMemoViewTotalSection.grandTotal}}" userInput="$10.00" stepKey="assertRefundOnCreditMemoTab"/> |
149 |
| - |
150 |
| - <after> |
151 |
| - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
152 |
| - |
153 |
| - <deleteData createDataKey="product" stepKey="delete"/> |
154 |
| - <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> |
155 |
| - <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> |
156 |
| - <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> |
157 |
| - </after> |
| 97 | + <actionGroup ref="AssertAdminCreditMemoViewPageTotalsActionGroup" stepKey="assertCreditMemoViewPageTotals"> |
| 98 | + <argument name="subtotal" value="$0.00"/> |
| 99 | + <argument name="adjustmentRefund" value="$10.00"/> |
| 100 | + <argument name="adjustmentFee" value="$0.00"/> |
| 101 | + <argument name="grandTotal" value="$10.00"/> |
| 102 | + </actionGroup> |
158 | 103 | </test>
|
159 | 104 | </tests>
|
0 commit comments