Skip to content

Commit

Permalink
Merge pull request magento#123 from magento-pangolin/MC-4758
Browse files Browse the repository at this point in the history
MC-4758
  • Loading branch information
tomreece authored May 23, 2019
2 parents 097e3da + ac3f1f9 commit fd6cb8d
Show file tree
Hide file tree
Showing 12 changed files with 645 additions and 0 deletions.
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>
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>
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>

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<element name="submitSearch22" type="button" selector=".//*[@class=&quot;admin__data-grid-filters-wrap&quot;]/parent::*/div[@class=&quot;data-grid-search-control-wrap&quot;]/button"/>
<element name="filters" type="button" selector="button[data-action='grid-filter-expand']" timeout="30"/>
<element name="idFilter" type="input" selector=".admin__data-grid-filters input[name='increment_id']"/>
<element name="selectStatus" type="select" selector="select[name='status']"/>
<element name="billToNameFilter" type="input" selector=".admin__data-grid-filters input[name='billing_name']"/>
<element name="enabledFilters" type="block" selector=".admin__data-grid-header .admin__data-grid-filters-current._show"/>
<element name="clearFilters" type="button" selector=".admin__data-grid-header [data-action='grid-filter-reset']" timeout="30"/>
Expand All @@ -31,9 +32,12 @@
<element name="viewColumnCheckbox" type="checkbox" selector="//div[contains(@class,'admin__data-grid-action-columns')]//div[contains(@class, 'admin__field-option')]//label[text() = '{{column}}']/preceding-sibling::input" parameterized="true"/>
<element name="customerInOrdersSection" type="button" selector="(//td[contains(text(),'{{customer}}')])[1]" parameterized="true"/>
<element name="productForOrder" type="button" selector="//td[contains(text(),'{{var}}')]" parameterized="true"/>
<element name="selectActions" type="button" selector=".action-select-wrap > .action-select" timeout="30"/>
<element name="dropdownActionItem" type="button" selector="(//div[contains(@class, 'action-menu-items')]//span[text()='{{action}}'])[1]" timeout="30" parameterized="true"/>
<element name="checkOrder" type="input" selector="//td[count(//div[@data-role='grid-wrapper'])]//input"/>
<element name="orderActions" type="button" selector="//div[contains(concat(' ',normalize-space(@class),' '),' row-gutter ')]//button[@title='Select Items']"/>
<element name="changeOrderStatus" type="button" selector="//div[contains(concat(' ',normalize-space(@class),' '),' row-gutter ')]//span[text()='{{status}}']" parameterized="true" timeout="30"/>
<element name="viewLink" type="text" selector="//td/div[contains(.,'{{orderID}}')]/../..//a[@class='action-menu-item']" parameterized="true"/>
<element name="selectOrderID" type="checkbox" selector="//td/div[text()='{{orderId}}']/../preceding-sibling::td//input" parameterized="true"/>
</section>
</sections>
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>
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>
Loading

0 comments on commit fd6cb8d

Please sign in to comment.