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#114 from magento-pangolin/MC-4776
MC-4776
- Loading branch information
Showing
14 changed files
with
285 additions
and
5 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
22 changes: 22 additions & 0 deletions
22
app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderStatusByLabelAndCodeActionGroup.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,22 @@ | ||
<?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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="FilterOrderStatusByLabelAndCodeActionGroup"> | ||
<arguments> | ||
<argument name="statusLabel" type="string"/> | ||
<argument name="statusCode" type="string"/> | ||
</arguments> | ||
<conditionalClick selector="{{AdminOrderStatusGridSection.resetFilter}}" dependentSelector="{{AdminOrderStatusGridSection.resetFilter}}" visible="true" stepKey="clearOrderStatusFilters" /> | ||
<fillField selector="{{AdminOrderStatusGridSection.statusLabel}}" userInput="{{statusLabel}}" stepKey="fillStatusLabel"/> | ||
<fillField selector="{{AdminOrderStatusGridSection.statusCode}}" userInput="{{statusCode}}" stepKey="fillStatusCode"/> | ||
<click selector="{{AdminOrderStatusGridSection.search}}" stepKey="clickSearch"/> | ||
<waitForPageLoad stepKey="waitForSearch"/> | ||
</actionGroup> | ||
</actionGroups> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectActionForOrdersActionGroup.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,19 @@ | ||
<?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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="SelectActionForOrdersActionGroup"> | ||
<arguments> | ||
<argument name="action" type="string"/> | ||
</arguments> | ||
<checkOption selector="{{AdminOrdersGridSection.checkOrder}}" stepKey="checkOrder"/> | ||
<click selector="{{AdminOrdersGridSection.orderActions}}" stepKey="clickOrderActions"/> | ||
<click selector="{{AdminOrdersGridSection.changeOrderStatus(action)}}" stepKey="changeOrdersAction"/> | ||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
app/code/Magento/Sales/Test/Mftf/Data/OrderActionsData.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,21 @@ | ||
<?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="OrderActions" type="orderActions"> | ||
<data key="cancel">Cancel</data> | ||
<data key="hold">Hold</data> | ||
<data key="unhold">Unhold</data> | ||
<data key="printInvoices">Print Invoices</data> | ||
<data key="printPackingSlips">Print Packing Slips</data> | ||
<data key="printCreditMemos">Print Credit Memos</data> | ||
<data key="printAll">Print All</data> | ||
<data key="printShippingLabels">Print Shipping Labels</data> | ||
</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,21 @@ | ||
<?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="OrderState" type="state"> | ||
<data key="canceled">Canceled</data> | ||
<data key="closed">Closed</data> | ||
<data key="complete">Complete</data> | ||
<data key="payment_review">Payment Review</data> | ||
<data key="processing">Processing</data> | ||
<data key="holded">On Hold</data> | ||
<data key="new">Pending</data> | ||
<data key="pending_payment">Pending Payment</data> | ||
</entity> | ||
</entities> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/Sales/Test/Mftf/Data/OrderStatusConfigData.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,18 @@ | ||
<?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="EnableCheckmoOrderStatusPending"> | ||
<data key="path">payment/checkmo/order_status</data> | ||
<data key="scope">payment</data> | ||
<data key="scope_id">1</data> | ||
<data key="label">Pending</data> | ||
<data key="value">pending</data> | ||
</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
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
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
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
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
134 changes: 134 additions & 0 deletions
134
app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.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,134 @@ | ||
<?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="AssignCustomOrderStatusNotVisibleOnStorefrontTest"> | ||
<annotations> | ||
<features value="Sales"/> | ||
<stories value="Assign Custom Order Status"/> | ||
<title value="Assign custom order status not visible on storefront test"/> | ||
<description value="Assign custom order status not visible on storefront"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-16053"/> | ||
<group value="sales"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
<before> | ||
<!-- Create customer --> | ||
<createData entity="Simple_US_Customer" stepKey="createCustomer"/> | ||
|
||
<!-- Create product --> | ||
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> | ||
|
||
<!-- Login as admin --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<!-- Disable created order status --> | ||
<magentoCLI command="config:set {{EnableCheckmoOrderStatusPending.path}} {{EnableCheckmoOrderStatusPending.value}}" stepKey="rollbackNewOrderStatus"/> | ||
|
||
<!-- Logout customer --> | ||
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> | ||
|
||
<!-- Delete product --> | ||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> | ||
|
||
<!-- Delete customer --> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> | ||
|
||
<!-- Log out --> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Create order status --> | ||
<amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> | ||
<waitForPageLoad stepKey="waitForOrderStatusPageLoad"/> | ||
<click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> | ||
|
||
<!-- Fill form and validate message --> | ||
<actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> | ||
<argument name="status" value="{{defaultOrderStatus.status}}"/> | ||
<argument name="label" value="{{defaultOrderStatus.label}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertOrderStatusFormSaveSuccess" stepKey="seeFormSaveSuccess"/> | ||
|
||
<!-- Assign status to state --> | ||
<click selector="{{AdminOrderStatusGridSection.assignStatusToStateBtn}}" stepKey="clickAssignStatusBtn"/> | ||
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderStatus}}" userInput="{{defaultOrderStatus.status}}" stepKey="selectOrderStatus"/> | ||
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderState}}" userInput="{{OrderState.new}}" stepKey="selectOrderState"/> | ||
<checkOption selector="{{AdminAssignOrderStatusToStateSection.orderStatusAsDefault}}" stepKey="orderStatusAsDefault"/> | ||
<uncheckOption selector="{{AdminAssignOrderStatusToStateSection.visibleOnStorefront}}" stepKey="visibleOnStorefront"/> | ||
<click selector="{{AdminAssignOrderStatusToStateSection.saveStatusAssignment}}" stepKey="clickSaveStatus"/> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="You assigned the order status." stepKey="seeSuccess"/> | ||
|
||
<!-- Prepare data for constraints --> | ||
<magentoCLI command="config:set {{EnableCheckmoOrderStatusPending.path}} {{defaultOrderStatus.label}}" stepKey="enableNewOrderStatus"/> | ||
|
||
<!-- Assert order status in grid --> | ||
<actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterOrderStatusGrid"> | ||
<argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> | ||
<argument name="statusCode" value="{{defaultOrderStatus.status}}"/> | ||
</actionGroup> | ||
<see selector="{{AdminOrderStatusGridSection.gridCell('1', 'State Code and Title')}}" userInput="new[{{defaultOrderStatus.label}}]" stepKey="seeOrderStatusInOrderGrid"/> | ||
|
||
<!-- Create order and grab order id --> | ||
<actionGroup ref="CreateOrderActionGroup" stepKey="createNewOrder"> | ||
<argument name="product" value="$$createSimpleProduct$$"/> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> | ||
|
||
<!-- Assert order status is correct --> | ||
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> | ||
<waitForPageLoad stepKey="waitForOrdersPageLoad"/> | ||
<actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> | ||
<argument name="orderId" value="$getOrderId"/> | ||
</actionGroup> | ||
<click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> | ||
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{defaultOrderStatus.label}}" stepKey="seeOrderStatus"/> | ||
|
||
<!-- Login as customer --> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> | ||
<argument name="Customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<waitForPageLoad stepKey="waitForCustomerLogin"/> | ||
|
||
<!-- Open My Orders --> | ||
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToCustomerDashboardPage"/> | ||
<waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/> | ||
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToMyOrdersPage"> | ||
<argument name="menu" value="My Orders"/> | ||
</actionGroup> | ||
|
||
<!-- Assert order not visible on My Orders --> | ||
<see selector="{{StorefrontOrderInformationMainSection.emptyMessage}}" userInput="You have placed no orders." stepKey="seeEmptyMessage"/> | ||
|
||
<!-- Cancel order --> | ||
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToAdminOrdersPage"/> | ||
<waitForPageLoad stepKey="waitForAdminOrdersPageLoad"/> | ||
<actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridByOrderId"> | ||
<argument name="orderId" value="$getOrderId"/> | ||
</actionGroup> | ||
<checkOption selector="{{AdminOrdersGridSection.checkOrder}}" stepKey="selectOrder"/> | ||
<actionGroup ref="SelectActionForOrdersActionGroup" stepKey="selectCancelOrderAction"> | ||
<argument name="action" value="{{OrderActions.cancel}}"/> | ||
</actionGroup> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="We canceled 1 order(s)." stepKey="seeSuccessMessage"/> | ||
|
||
<!-- Unassign order status --> | ||
<amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatus"/> | ||
<waitForPageLoad stepKey="waitForStatusPageLoad"/> | ||
<actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid"> | ||
<argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> | ||
<argument name="statusCode" value="{{defaultOrderStatus.status}}"/> | ||
</actionGroup> | ||
<click selector="{{AdminOrderStatusGridSection.unassign}}" stepKey="unassignOrderStatus"/> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="You have unassigned the order status." stepKey="seeMessage"/> | ||
</test> | ||
</tests> |
30 changes: 30 additions & 0 deletions
30
app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusVisibleOnStorefrontTest.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. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AssignCustomOrderStatusVisibleOnStorefrontTest" extends="AssignCustomOrderStatusNotVisibleOnStorefrontTest"> | ||
<annotations> | ||
<features value="Sales"/> | ||
<stories value="Assign Custom Order Status"/> | ||
<title value="Assign custom order status visible on storefront test"/> | ||
<description value="Assign custom order status visible on storefront"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-16054"/> | ||
<group value="sales"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
<remove keyForRemoval="seeEmptyMessage"/> | ||
|
||
<!-- Assign status to state part --> | ||
<checkOption selector="{{AdminAssignOrderStatusToStateSection.visibleOnStorefront}}" stepKey="visibleOnStorefront"/> | ||
|
||
<!-- Assert order in orders grid on frontend --> | ||
<see selector="{{StorefrontCustomerOrderSection.status}}" userInput="{{defaultOrderStatus.label}}" stepKey="seeOrderStatusOnStorefront" after="goToMyOrdersPage"/> | ||
</test> | ||
</tests> |
Oops, something went wrong.