Skip to content

Commit

Permalink
Merge pull request magento#104 from magento-pangolin/MC-4760
Browse files Browse the repository at this point in the history
MC-4760
  • Loading branch information
tomreece committed May 2, 2019
2 parents 83af2be + 94ac590 commit f837766
Show file tree
Hide file tree
Showing 29 changed files with 851 additions and 9 deletions.
@@ -0,0 +1,15 @@
<?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="AssertOrderGraphImageOnDashboardActionGroup">
<click selector="{{AdminDashboardSection.ordersTab}}" stepKey="clickOrdersBtn"/>
<seeElement selector="{{AdminDashboardSection.ordersChart}}" stepKey="seeGraphImage"/>
</actionGroup>
</actionGroups>
Expand Up @@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminDashboardPage" url="admin/dashboard/" area="admin" module="Magento_Backend">
<section name="AdminMenuSection"/>
<section name="AdminDashboardSection"/>
</page>
</pages>
Expand Up @@ -9,6 +9,8 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminDashboardSection">
<element name="ordersTab" type="button" selector="#diagram_tab_orders"/>
<element name="ordersChart" type="button" selector="#diagram_tab_orders_content .dashboard-diagram-image img"/>
<element name="dashboardDiagramContent" type="button" selector="#diagram_tab_content"/>
<element name="dashboardDiagramOrderContentTab" type="block" selector="#diagram_tab_orders_content"/>
<element name="dashboardDiagramAmounts" type="button" selector="#diagram_tab_amounts"/>
Expand Down
Expand Up @@ -13,6 +13,7 @@
<element name="productCustomOptions" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd[normalize-space(.)='{{var3}}']" parameterized="true"/>
<element name="productCustomOptionsFile" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd[contains(.,'{{var3}}')]" parameterized="true"/>
<element name="productCustomOptionsLink" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd//a[text() = '{{var3}}']" parameterized="true"/>
<element name="viewOrder" type="button" selector="//td[contains(concat(' ',normalize-space(@class),' '),' col actions ')]/a[contains(concat(' ',normalize-space(@class),' '),' action view ')]"/>
<element name="tabRefund" type="button" selector="//a[text()='Refunds']"/>
<element name="grandTotalRefund" type="text" selector="td[data-th='Grand Total'] > strong > span.price"/>
</section>
Expand Down
Expand Up @@ -10,38 +10,38 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="BankTransferEnableConfigData">
<data key="path">payment/banktransfer/active</data>
<data key="scope_id">0</data>
<data key="scope_id">1</data>
<data key="label">Yes</data>
<data key="value">1</data>
</entity>
<entity name="BankTransferDisabledConfigData">
<data key="path">payment/banktransfer/active</data>
<data key="scope_id">0</data>
<data key="label">Yes</data>
<data key="scope_id">1</data>
<data key="label">No</data>
<data key="value">0</data>
</entity>
<entity name="PurchaseOrderEnableConfigData">
<data key="path">payment/purchaseorder/active</data>
<data key="scope_id">0</data>
<data key="scope_id">1</data>
<data key="label">Yes</data>
<data key="value">1</data>
</entity>
<entity name="PurchaseOrderDisabledConfigData">
<data key="path">payment/purchaseorder/active</data>
<data key="scope_id">0</data>
<data key="label">Yes</data>
<data key="scope_id">1</data>
<data key="label">No</data>
<data key="value">0</data>
</entity>
<entity name="CashOnDeliveryEnableConfigData">
<data key="path">payment/cashondelivery/active</data>
<data key="scope_id">0</data>
<data key="scope_id">1</data>
<data key="label">Yes</data>
<data key="value">1</data>
</entity>
<entity name="CashOnDeliveryDisabledConfigData">
<data key="path">payment/cashondelivery/active</data>
<data key="scope_id">0</data>
<data key="label">Yes</data>
<data key="scope_id">1</data>
<data key="label">No</data>
<data key="value">0</data>
</entity>
</entities>
@@ -0,0 +1,20 @@
<?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="AdminApplyCouponToOrderActionGroup">
<arguments>
<argument name="couponCode" type="string"/>
</arguments>
<fillField selector="{{AdminOrderFormItemsSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode"/>
<click selector="{{AdminOrderFormItemsSection.applyCoupon}}" stepKey="applyCoupon"/>
<waitForPageLoad stepKey="waitForApplyingCoupon"/>
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The coupon code has been accepted." stepKey="seeSuccessMessage"/>
</actionGroup>
</actionGroups>
Expand Up @@ -80,4 +80,11 @@
<click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/>
<waitForPageLoad stepKey="waitForFiltersApply"/>
</actionGroup>

<actionGroup name="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" extends="filterInvoiceGridByOrderId">
<arguments>
<argument name="orderId" type="string"/>
</arguments>
<conditionalClick selector="{{AdminInvoicesGridSection.clearFilters}}" dependentSelector="{{AdminInvoicesGridSection.clearFilters}}" visible="true" stepKey="clearFilters" after="goToInvoices"/>
</actionGroup>
</actionGroups>
Expand Up @@ -112,6 +112,14 @@
<wait time="5" stepKey="waitForOptionsToLoad"/>
</actionGroup>

<actionGroup name="AddSimpleProductWithQtyToOrderActionGroup" extends="addSimpleProductToOrder">
<arguments>
<argument name="product" defaultValue="_defaultProduct" type="entity"/>
<argument name="productQty" type="string"/>
</arguments>
<fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/>
</actionGroup>

<!--Add configurable product to order -->
<actionGroup name="addConfigurableProductToOrder">
<arguments>
Expand Down Expand Up @@ -369,6 +377,28 @@
<conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/>
</actionGroup>

<!--Select Bank Transfer payment method-->
<actionGroup name="SelectBankTransferPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod">
<remove keyForRemoval="checkCheckMoneyOption"/>
<conditionalClick selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" dependentSelector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" visible="true" stepKey="checkBankTransferOption" after="waitForPaymentOptions"/>
</actionGroup>

<!--Select Cash on Delivery payment method-->
<actionGroup name="SelectCashOnDeliveryPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod">
<remove keyForRemoval="checkCheckMoneyOption"/>
<conditionalClick selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" dependentSelector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" visible="true" stepKey="checkCashOnDeliveryOption" after="waitForPaymentOptions"/>
</actionGroup>

<!--Select Purchase Order payment method-->
<actionGroup name="SelectPurchaseOrderPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod">
<arguments>
<argument name="purchaseOrderNumber" type="string"/>
</arguments>
<remove keyForRemoval="checkCheckMoneyOption"/>
<conditionalClick selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" dependentSelector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" visible="true" stepKey="checkPurchaseOrderOption" after="waitForPaymentOptions"/>
<fillField selector="{{AdminOrderFormPaymentSection.fieldPurchaseOrderNumber}}" userInput="{{purchaseOrderNumber}}" stepKey="fillPurchaseOrderNumber"/>
</actionGroup>

<!-- Create Order -->
<actionGroup name="CreateOrderActionGroup">
<arguments>
Expand Down
@@ -0,0 +1,15 @@
<?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="AdminSubmitOrderActionGroup">
<click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
<see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
</actionGroup>
</actionGroups>
@@ -0,0 +1,23 @@
<?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="FilterShipmentGridByOrderIdActionGroup">
<arguments>
<argument name="orderId" type="string"/>
</arguments>
<amOnPage url="{{AdminShipmentPage.url}}" stepKey="goToShipments"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearOrderFilters"/>
<click selector="{{AdminShipmentGridSection.filter}}" stepKey="clickFilter"/>
<fillField selector="{{AdminShipmentsFilterSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/>
<click selector="{{AdminShipmentsFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
<waitForPageLoad stepKey="waitForFiltersApply"/>
</actionGroup>
</actionGroups>
23 changes: 23 additions & 0 deletions app/code/Magento/Sales/Test/Mftf/Data/ConfigData.xml
@@ -0,0 +1,23 @@
<?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="AdminEnableDashboardCharts">
<data key="path">admin/dashboard/enable_charts</data>
<data key="scope_id">1</data>
<data key="label">Yes</data>
<data key="value">1</data>
</entity>
<entity name="AdminDisableDashboardCharts">
<data key="path">admin/dashboard/enable_charts</data>
<data key="scope_id">1</data>
<data key="label">No</data>
<data key="value">0</data>
</entity>
</entities>
Expand Up @@ -11,5 +11,6 @@
<page name="AdminInvoicesPage" url="sales/invoice/" area="admin" module="Magento_Sales">
<section name="AdminInvoicesGridSection"/>
<section name="AdminInvoicesFiltersSection"/>
<section name="AdminOrderInvoiceViewSection"/>
</page>
</pages>
14 changes: 14 additions & 0 deletions app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminShipmentPage" url="sales/shipment/" area="admin" module="Magento_Sales">
<section name="AdminShipmentGridSection"/>
</page>
</pages>
Expand Up @@ -12,5 +12,9 @@
<element name="subtotalRow" type="text" selector=".order-subtotal-table tbody > tr:nth-of-type({{row}}) td span.price" parameterized="true"/>
<element name="total" type="text" selector="//table[contains(@class,'order-subtotal-table')]/tbody/tr/td[contains(text(), '{{total}}')]/following-sibling::td/span/span[contains(@class, 'price')]" parameterized="true"/>
<element name="grandTotal" type="text" selector=".order-subtotal-table tfoot tr.col-0>td span.price"/>
<element name="invoiceComment" type="textarea" selector="[name='invoice[comment_text]']" timeout="30"/>
<element name="itemQty" type="text" selector="td.col-qty"/>
<element name="itemName" type="text" selector=".col-product .product-title"/>
<element name="itemTotalPrice" type="text" selector=".col-total .price"/>
</section>
</sections>
Expand Up @@ -12,5 +12,6 @@
<element name="spinner" type="button" selector=".spinner"/>
<element name="filter" type="button" selector="#container > div > div.admin__data-grid-header > div:nth-child(1) > div.data-grid-filters-actions-wrap > div > button"/>
<element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/>
<element name="clearFilters" type="button" selector="button.action-clear" timeout="30"/>
</section>
</sections>
Expand Up @@ -15,9 +15,13 @@
<element name="creditMemo" type="button" selector="#order_creditmemo" timeout="30"/>
<element name="hold" type="button" selector="#order-view-hold-button" timeout="30"/>
<element name="invoice" type="button" selector="#order_invoice" timeout="30"/>
<element name="invoiceTab" type="button" selector="#sales_order_view_tabs_order_invoices" timeout="30"/>
<element name="ship" type="button" selector="#order_ship" timeout="30"/>
<element name="reorder" type="button" selector="#order_reorder" timeout="30"/>
<element name="edit" type="button" selector="#order_edit" timeout="30"/>
<element name="modalOk" type="button" selector=".action-accept"/>
<element name="invoiceBtn" type="button" selector="//button[@title='Invoice']"/>
<element name="shipBtn" type="button" selector="//button[@title='Ship']"/>
<element name="shipmentsTab" type="button" selector="#sales_order_view_tabs_order_shipments"/>
</section>
</sections>
Expand Up @@ -33,5 +33,7 @@
<element name="updateItemsAndQuantities" type="button" selector="//span[contains(text(),'Update Items and Quantities')]"/>
<element name="creditMemo" type="input" selector="#order_creditmemo"/>
<element name="configure" type="button" selector=".product-configure-block button.action-default.scalable" timeout="30"/>
<element name="couponCode" type="input" selector="#order-coupons input" timeout="30"/>
<element name="applyCoupon" type="button" selector="#order-coupons button"/>
</section>
</sections>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminOrderInvoiceViewSection">
<element name="invoiceQty" type="input" selector=".input-text.admin__control-text.qty-input" timeout="30"/>
<element name="updateInvoiceBtn" type="button" selector=".update-button" timeout="30"/>
</section>
</sections>
Expand Up @@ -13,5 +13,11 @@
<element name="gridRow" type="text" selector="#sales_order_view_tabs_order_invoices_content .data-grid tbody > tr:nth-of-type({{row}})" parameterized="true"/>
<element name="viewGridRow" type="button" selector="#sales_order_view_tabs_order_invoices_content .data-grid tbody > tr:nth-of-type({{row}}) a[href*='order_invoice/view']" parameterized="true"/>
<element name="viewInvoice" type="button" selector="//div[@class='admin__data-grid-wrap']//a[@class='action-menu-item']"/>
<element name="clearFilters" type="button" selector="//div[@id='sales_order_view_tabs_order_invoices_content']//button[@data-action='grid-filter-reset']" timeout="30"/>
<element name="filters" type="button" selector="//div[@id='sales_order_view_tabs_order_invoices_content']//button[@data-action='grid-filter-expand']" timeout="30"/>
<element name="applyFilters" type="button" selector="//div[@id='sales_order_view_tabs_order_invoices_content']//button[@data-action='grid-filter-apply']" timeout="30"/>
<element name="invoiceId" type="input" selector="//div[@id='sales_order_view_tabs_order_invoices_content']//input[@name='increment_id']" timeout="30"/>
<element name="amountFrom" type="input" selector="[name='grand_total[from]']" timeout="30"/>
<element name="amountTo" type="input" selector="[name='grand_total[to]']" timeout="30"/>
</section>
</sections>
Expand Up @@ -12,5 +12,11 @@
<element name="spinner" type="text" selector="[data-role='spinner'][data-component*='sales_order_view_shipment']"/>
<element name="gridRow" type="text" selector="#sales_order_view_tabs_order_shipments_content .data-grid tbody > tr:nth-of-type({{row}})" parameterized="true"/>
<element name="viewGridRow" type="button" selector="#sales_order_view_tabs_order_shipments_content .data-grid tbody > tr:nth-of-type({{row}}) a[href*='order_shipment/view']" parameterized="true"/>
<element name="filters" type="button" selector="//div[@id='sales_order_view_tabs_order_shipments_content']//button[@data-action='grid-filter-expand']" timeout="30"/>
<element name="clearFilters" type="button" selector="//div[@id='sales_order_view_tabs_order_shipments_content']//button[@data-action='grid-filter-reset']" timeout="30"/>
<element name="applyFilters" type="button" selector="//div[@id='sales_order_view_tabs_order_shipments_content']//button[@data-action='grid-filter-apply']" timeout="30"/>
<element name="shipmentId" type="input" selector="//div[@id='sales_order_view_tabs_order_shipments_content']//input[@name='increment_id']" timeout="30"/>
<element name="totalQtyFrom" type="input" selector="[name='total_qty[from]']" timeout="30"/>
<element name="totalQtyTo" type="input" selector="[name='total_qty[to]']" timeout="30"/>
</section>
</sections>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminShipmentsFilterSection">
<element name="orderNum" type="input" selector="input[name='order_increment_id']"/>
<element name="applyFilters" type="button" selector="button[data-action='grid-filter-apply']" timeout="30"/>
</section>
</sections>

0 comments on commit f837766

Please sign in to comment.