Skip to content

Commit 7dcd88b

Browse files
committed
added selector AdminOrdersGridSection.orderIdByIncrementId
Please enter the commit message for your changes. Lines starting
1 parent d2ab2f3 commit 7dcd88b

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
<element name="viewLink" type="text" selector="//td/div[contains(.,'{{orderID}}')]/../..//a[@class='action-menu-item']" parameterized="true"/>
4242
<element name="selectOrderID" type="checkbox" selector="//td/div[text()='{{orderId}}']/../preceding-sibling::td//input" parameterized="true" timeout="60"/>
4343
<element name="orderId" type="text" selector="//table[contains(@class, 'data-grid')]//div[contains(text(), '{{orderId}}')]" parameterized="true"/>
44+
<element name="orderIdByIncrementId" type="text" selector="//input[@class='admin__control-checkbox' and @value={{incrId}}]/parent::label/parent::td/following-sibling::td" parameterized="true"/>
4445
</section>
4546
</sections>

app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/>
3131
<element name="applyCoupon" type="input" selector="#coupons:code"/>
3232
<element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/>
33+
3334
</section>
3435
</sections>

app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
<createData entity="GuestCart" stepKey="createGuestCartTwo"/>
5252
<createData entity="SimpleCartItem" stepKey="addCartItemTwo">
53-
<requiredEntity createDataKey="createGuestCartTow"/>
53+
<requiredEntity createDataKey="createGuestCartTwo"/>
5454
<requiredEntity createDataKey="createSimpleProduct"/>
5555
</createData>
5656
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressTwo">
@@ -71,7 +71,6 @@
7171
</before>
7272
<after>
7373
<!-- Delete data -->
74-
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
7574
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
7675
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
7776
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
@@ -103,32 +102,44 @@
103102
<!-- Create CreditMemo for second Order -->
104103
<!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> -->
105104

105+
<!-- <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderOne">
106+
<argument name="entityId" value="$createGuestCartOne.return$"/>
107+
</actionGroup>
108+
<grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderOneId"/>
109+
110+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderTwo">
111+
<argument name="entityId" value="$createGuestCartTwo.return$"/>
112+
</actionGroup> -->
113+
106114
<!-- Navigate to backend: Go to Sales > Orders -->
107115
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/>
108116
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
109117

118+
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartOne.return$)}}" stepKey="getOrderOneId"/>
119+
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartTwo.return$)}}" stepKey="getOrderTwoId"/>
120+
110121
<!-- Select Mass Action according to dataset: Cancel -->
111122
<actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel">
112123
<argument name="action" value="Cancel"/>
113-
<argument name="orderId" value="$createGuestCartOne.return$"/>
114-
<argument name="secondOrderId" value="$createGuestCartTwo.return$"/>
124+
<argument name="orderId" value="$getOrderOneId"/>
125+
<argument name="secondOrderId" value="$getOrderTwoId"/>
115126
</actionGroup>
116127
<see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/>
117128

118129
<!--Assert first order in orders grid -->
119130
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder">
120-
<argument name="orderId" value="$createGuestCartOne.return$"/>
131+
<argument name="orderId" value="$getOrderOneId"/>
121132
<argument name="orderStatus" value="Complete"/>
122133
</actionGroup>
123-
<see userInput="$createGuestCartOne.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/>
134+
<see userInput="$getOrderOneId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/>
124135
<see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/>
125136

126137
<!--Assert second order in orders grid -->
127138
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder">
128-
<argument name="orderId" value="$createGuestCartTwo.return$"/>
139+
<argument name="orderId" value="$getOrderTwoId"/>
129140
<argument name="orderStatus" value="Closed"/>
130141
</actionGroup>
131-
<see userInput="$createGuestCartTwo.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/>
142+
<see userInput="$getOrderTwoId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/>
132143
<see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/>
133144
</test>
134145
</tests>

0 commit comments

Comments
 (0)