-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-8538: [MFTF] Refactoring of AdminMassOrdersCancelCompleteAndCl…
…osedTest #31123 - Merge Pull Request #31123 from AnnaAPak/magento2:ref-AdminMassOrdersCancelCompleteAndClosedAPITest - Merged commits: 1. 9847f03 2. e34fc78 3. beb0fda 4. 320748f 5. d2ab2f3 6. 7dcd88b 7. 732c6ff 8. a70dfc9 9. a5dd5e9 10. 424754f 11. 035442d 12. aaea37c 13. bc231ce 14. de26bef
- Loading branch information
Showing
9 changed files
with
215 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
|
||
<entity name="CreditMemo" type="CreditMemo"> | ||
<var key="quote_id" entityKey="return" entityType="CustomerCart"/> | ||
</entity> | ||
|
||
</entities> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
|
||
<entity name="Invoice" type="Invoice"> | ||
<var key="quote_id" entityKey="return" entityType="CustomerCart"/> | ||
</entity> | ||
|
||
</entities> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
|
||
<entity name="Shipment" type="Shipment"> | ||
<var key="quote_id" entityKey="return" entityType="CustomerCart"/> | ||
</entity> | ||
|
||
</entities> |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> | ||
<operation name="CreateCreditMemo" dataType="CreditMemo" type="create" auth="adminOauth" url="V1/order/{return}/refund" method="POST"> | ||
<contentType>application/json</contentType> | ||
<object key="cartItem" dataType="CartItem"> | ||
<field key="quote_id">string</field> | ||
</object> | ||
</operation> | ||
</operations> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> | ||
<operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/{return}/invoice" method="POST"> | ||
<contentType>application/json</contentType> | ||
<object key="cartItem" dataType="CartItem"> | ||
<field key="quote_id">string</field> | ||
</object> | ||
</operation> | ||
</operations> |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> | ||
<operation name="CreateShipment" dataType="Shipment" type="create" auth="adminOauth" url="V1/order/{return}/ship" method="POST"> | ||
<contentType>application/json</contentType> | ||
<object key="cartItem" dataType="CartItem"> | ||
<field key="quote_id">string</field> | ||
</object> | ||
</operation> | ||
</operations> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminMassOrdersCancelClosedAndCompleteTest"> | ||
<annotations> | ||
<stories value="Mass Update Orders"/> | ||
<title value="Mass cancel orders in status Complete, Closed"/> | ||
<description value="Try to cancel orders in status Complete, Closed"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-39905"/> | ||
<group value="sales"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
|
||
<before> | ||
|
||
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> | ||
|
||
<createData entity="ApiCategory" stepKey="createCategory"/> | ||
|
||
<createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<createData entity="GuestCart" stepKey="createGuestCartOne"/> | ||
<createData entity="SimpleCartItem" stepKey="addCartItemOne"> | ||
<requiredEntity createDataKey="createGuestCartOne"/> | ||
<requiredEntity createDataKey="createSimpleProduct"/> | ||
</createData> | ||
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressOne"> | ||
<requiredEntity createDataKey="createGuestCartOne"/> | ||
</createData> | ||
<updateData createDataKey="createGuestCartOne" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformationOne"> | ||
<requiredEntity createDataKey="createGuestCartOne"/> | ||
</updateData> | ||
|
||
<createData entity="Invoice" stepKey="invoiceOrderOne"> | ||
<requiredEntity createDataKey="createGuestCartOne"/> | ||
</createData> | ||
|
||
<createData entity="Shipment" stepKey="shipOrderOne"> | ||
<requiredEntity createDataKey="createGuestCartOne"/> | ||
</createData> | ||
|
||
<createData entity="GuestCart" stepKey="createGuestCartTwo"/> | ||
<createData entity="SimpleCartItem" stepKey="addCartItemTwo"> | ||
<requiredEntity createDataKey="createGuestCartTwo"/> | ||
<requiredEntity createDataKey="createSimpleProduct"/> | ||
</createData> | ||
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressTwo"> | ||
<requiredEntity createDataKey="createGuestCartTwo"/> | ||
</createData> | ||
<updateData createDataKey="createGuestCartTwo" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformationTwo"> | ||
<requiredEntity createDataKey="createGuestCartTwo"/> | ||
</updateData> | ||
|
||
<createData entity="Invoice" stepKey="invoiceOrderTwo"> | ||
<requiredEntity createDataKey="createGuestCartTwo"/> | ||
</createData> | ||
|
||
<createData entity="CreditMemo" stepKey="refundOrderTwo"> | ||
<requiredEntity createDataKey="createGuestCartTwo"/> | ||
</createData> | ||
|
||
</before> | ||
|
||
<after> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> | ||
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> | ||
|
||
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartOne.return$)}}" stepKey="getOrderOneId"/> | ||
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartTwo.return$)}}" stepKey="getOrderTwoId"/> | ||
|
||
<actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> | ||
<argument name="action" value="Cancel"/> | ||
<argument name="orderId" value="$getOrderOneId"/> | ||
<argument name="secondOrderId" value="$getOrderTwoId"/> | ||
</actionGroup> | ||
<see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> | ||
|
||
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> | ||
<argument name="orderId" value="$getOrderOneId"/> | ||
<argument name="orderStatus" value="Complete"/> | ||
</actionGroup> | ||
<see userInput="$getOrderOneId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> | ||
<see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> | ||
|
||
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> | ||
<argument name="orderId" value="$getOrderTwoId"/> | ||
<argument name="orderStatus" value="Closed"/> | ||
</actionGroup> | ||
<see userInput="$getOrderTwoId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> | ||
<see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters