forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request magento#123 from magento-pangolin/MC-4758
MC-4758
- Loading branch information
Showing
12 changed files
with
645 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.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,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminCreateInvoiceActionGroup"> | ||
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/> | ||
<waitForPageLoad stepKey="waitForInvoicePage"/> | ||
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/> | ||
<waitForPageLoad stepKey="waitForLoadPage"/> | ||
<see userInput="The invoice has been created." stepKey="seeMessage"/> | ||
</actionGroup> | ||
<actionGroup name="AdminCreateInvoiceAndShipmentActionGroup" extends="AdminCreateInvoiceActionGroup"> | ||
<checkOption selector="{{AdminInvoicePaymentShippingSection.CreateShipment}}" stepKey="checkCreateShipment" after="waitForInvoicePage"/> | ||
<see userInput="You created the invoice and shipment." stepKey="seeMessage"/> | ||
</actionGroup> | ||
<actionGroup name="AdminCreateInvoiceAndCreditMemoActionGroup" extends="AdminCreateInvoiceActionGroup"> | ||
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="pushButtonCreditMemo" after="seeMessage"/> | ||
<waitForPageLoad stepKey="waitForLoadingCreditMemoPage" after="pushButtonCreditMemo"/> | ||
<scrollTo selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="scrollToBottom" after="waitForLoadingCreditMemoPage"/> | ||
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitRefund" after="scrollToBottom"/> | ||
<waitForPageLoad stepKey="waitForMainOrderPageLoad" after="clickSubmitRefund"/> | ||
<see userInput="You created the credit memo." stepKey="seeCreditMemoMessage" after="waitForMainOrderPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
29 changes: 29 additions & 0 deletions
29
app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionOnGridActionGroup.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,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminOrderActionOnGridActionGroup"> | ||
<arguments> | ||
<argument name="action" type="string"/> | ||
<argument name="orderId" type="string"/> | ||
</arguments> | ||
<checkOption selector="{{AdminOrdersGridSection.selectOrderID(orderId)}}" stepKey="selectOrder"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForCheck"/> | ||
<click selector="{{AdminOrdersGridSection.selectActions}}" stepKey="openActions"/> | ||
<click selector="{{AdminOrdersGridSection.dropdownActionItem(action)}}" stepKey="selectAction"/> | ||
<waitForPageLoad stepKey="waitForResults"/> | ||
</actionGroup> | ||
<actionGroup name="AdminTwoOrderActionOnGridActionGroup" extends="AdminOrderActionOnGridActionGroup"> | ||
<arguments> | ||
<argument name="secondOrderId" type="string"/> | ||
</arguments> | ||
<checkOption selector="{{AdminOrdersGridSection.selectOrderID(secondOrderId)}}" stepKey="selectSecondOrder" after="waitForCheck"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForSecondCheck" after="selectSecondOrder"/> | ||
</actionGroup> | ||
</actionGroups> |
26 changes: 26 additions & 0 deletions
26
...ode/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderFilterByOrderIdAndStatusActionGroup.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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminOrderFilterByOrderIdAndStatusActionGroup"> | ||
<arguments> | ||
<argument name="orderId" type="string"/> | ||
<argument name="orderStatus" type="string"/> | ||
</arguments> | ||
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> | ||
<waitForPageLoad stepKey="waitForLoadingPage"/> | ||
<conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> | ||
<click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> | ||
<fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> | ||
<selectOption selector="{{AdminOrdersGridSection.selectStatus}}" userInput="{{orderStatus}}" stepKey="selectOrderStatus"/> | ||
<click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> | ||
</actionGroup> | ||
</actionGroups> | ||
|
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
91 changes: 91 additions & 0 deletions
91
app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.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,91 @@ | ||
<?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="AdminMassOrdersCancelCompleteAndClosedTest"> | ||
<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-16183"/> | ||
<group value="sales"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="LoginAsAdmin" 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="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Create first order --> | ||
<actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<grabTextFrom selector="|Order # (\d+)|" stepKey="getFirstOrderId"/> | ||
<assertNotEmpty actual="$getFirstOrderId" stepKey="assertOrderIdIsNotEmpty" after="getFirstOrderId"/> | ||
|
||
<!-- Create Shipment for first Order --> | ||
<actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipmentForFirstOrder"/> | ||
|
||
<!-- Create second order --> | ||
<actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<grabTextFrom selector="|Order # (\d+)|" stepKey="getSecondOrderId"/> | ||
<assertNotEmpty actual="$getSecondOrderId" stepKey="assertSecondOrderIdIsNotEmpty" after="getSecondOrderId"/> | ||
|
||
<!-- Create CreditMemo for second Order --> | ||
<actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> | ||
|
||
<!-- Navigate to backend: Go to Sales > Orders --> | ||
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrderPage"/> | ||
<waitForPageLoad stepKey="waitForOrderPageLoad"/> | ||
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/> | ||
|
||
<!-- Select Mass Action according to dataset: Cancel --> | ||
<actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> | ||
<argument name="action" value="Cancel"/> | ||
<argument name="orderId" value="{$getFirstOrderId}"/> | ||
<argument name="secondOrderId" value="{$getSecondOrderId}"/> | ||
</actionGroup> | ||
<see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> | ||
|
||
<!--Assert first order in orders grid --> | ||
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> | ||
<argument name="orderId" value="{$getFirstOrderId}"/> | ||
<argument name="orderStatus" value="Complete"/> | ||
</actionGroup> | ||
<see userInput="{$getFirstOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> | ||
<see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> | ||
|
||
<!--Assert second order in orders grid --> | ||
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> | ||
<argument name="orderId" value="{$getSecondOrderId}"/> | ||
<argument name="orderStatus" value="Closed"/> | ||
</actionGroup> | ||
<see userInput="{$getSecondOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> | ||
<see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> | ||
</test> | ||
</tests> |
91 changes: 91 additions & 0 deletions
91
app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.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,91 @@ | ||
<?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="AdminMassOrdersCancelProcessingAndClosedTest"> | ||
<annotations> | ||
<stories value="Mass Update Orders"/> | ||
<title value="Mass cancel orders in status Processing, Closed"/> | ||
<description value="Try to cancel orders in status Processing, Closed"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-16184"/> | ||
<group value="sales"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="LoginAsAdmin" 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="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Create first order --> | ||
<actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<grabTextFrom selector="|Order # (\d+)|" stepKey="getFirstOrderId"/> | ||
<assertNotEmpty actual="$getFirstOrderId" stepKey="assertOrderIdIsNotEmpty" after="getFirstOrderId"/> | ||
|
||
<!-- Create Invoice for first Order --> | ||
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/> | ||
|
||
<!-- Create second order --> | ||
<actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<grabTextFrom selector="|Order # (\d+)|" stepKey="getSecondOrderId"/> | ||
<assertNotEmpty actual="$getSecondOrderId" stepKey="assertSecondOrderIdIsNotEmpty" after="getSecondOrderId"/> | ||
|
||
<!-- Create CreditMemo for second Order --> | ||
<actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> | ||
|
||
<!-- Navigate to backend: Go to Sales > Orders --> | ||
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrderPage"/> | ||
<waitForPageLoad stepKey="waitForOrderPageLoad"/> | ||
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/> | ||
|
||
<!-- Select Mass Action according to dataset: Cancel --> | ||
<actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> | ||
<argument name="action" value="Cancel"/> | ||
<argument name="orderId" value="{$getFirstOrderId}"/> | ||
<argument name="secondOrderId" value="{$getSecondOrderId}"/> | ||
</actionGroup> | ||
<see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> | ||
|
||
<!--Assert first order in orders grid --> | ||
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> | ||
<argument name="orderId" value="{$getFirstOrderId}"/> | ||
<argument name="orderStatus" value="Processing"/> | ||
</actionGroup> | ||
<see userInput="{$getFirstOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> | ||
<see userInput="Processing" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> | ||
|
||
<!--Assert second order in orders grid --> | ||
<actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> | ||
<argument name="orderId" value="{$getSecondOrderId}"/> | ||
<argument name="orderStatus" value="Closed"/> | ||
</actionGroup> | ||
<see userInput="{$getSecondOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> | ||
<see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> | ||
</test> | ||
</tests> |
Oops, something went wrong.