Skip to content

Commit

Permalink
Merge pull request magento#117 from magento-pangolin/MC-4765
Browse files Browse the repository at this point in the history
MC-4765
  • Loading branch information
tomreece authored May 16, 2019
2 parents c383b4c + e1c5071 commit c09e4af
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminCustomerActivitiesLastOrderedSection">
<element name="addProductToOrder" type="text" selector="//div[@id='sidebar_data_reorder']//tr[td[.='{{productName}}']]//input[contains(@name,'add')]" parameterized="true" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?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="MoveLastOrderedConfigurableProductOnOrderPageTest">
<annotations>
<features value="Sales"/>
<stories value="Add Products to Order from Last Ordered Products Section"/>
<title value="Move last ordered configurable product on order page test"/>
<description value="Move last ordered configurable product on order page"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-16155"/>
<group value="sales"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

<!-- Create customer -->
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>

<!-- Create category -->
<createData entity="_defaultCategory" stepKey="createCategory"/>

<!-- Create configurable product -->
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption"/>
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct"/>
</createData>
</before>
<after>
<!-- Delete created data -->
<actionGroup ref="logout" stepKey="logout"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/>
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>

<!-- Create order -->
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage">
<argument name="customer" value="$$createCustomer$$"/>
</actionGroup>

<!-- Add configurable product to order -->
<actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder">
<argument name="product" value="$$createConfigProduct$$"/>
<argument name="attribute" value="$$createConfigProductAttribute$$"/>
<argument name="option" value="$$getConfigAttributeOption$$"/>
</actionGroup>

<!-- Select shipping method -->
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>

<!-- Submit order -->
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>

<!-- Search and open customer -->
<actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer">
<argument name="email" value="$$createCustomer.email$$"/>
</actionGroup>
<click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickEditButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>

<!-- Click create order -->
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>

<!-- Select product in Last Ordered Items section -->
<click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder($$createConfigProduct.name$$)}}" stepKey="addProductToOrder"/>

<!-- Click Update Changes -->
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/>

<!-- Assert product in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeProductPrice"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?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="MoveLastOrderedSimpleProductOnOrderPageTest">
<annotations>
<features value="Sales"/>
<stories value="Add Products to Order from Last Ordered Products Section"/>
<title value="Move last ordered simple product on order page test"/>
<description value="Move last ordered simple product on order page"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-16154"/>
<group value="sales"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

<!-- Create customer -->
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>

<!-- Create product -->
<createData entity="SimpleProduct2" stepKey="createProduct"/>
</before>
<after>
<!-- Delete created data -->
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<actionGroup ref="logout" stepKey="logOut"/>
</after>

<!-- Create order -->
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
<argument name="product" value="$$createProduct$$"/>
<argument name="customer" value="$$createCustomer$$"/>
</actionGroup>

<!-- Search and open customer -->
<actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer">
<argument name="email" value="$$createCustomer.email$$"/>
</actionGroup>
<click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickEditButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>

<!-- Click create order -->
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>

<!-- Select product in Last Ordered Items section -->
<click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder($$createProduct.name$$)}}" stepKey="addProductToOrder"/>

<!-- Click Update Changes -->
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/>

<!-- Assert product in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createProduct.price$$" stepKey="seeProductPrice"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
<testCase name="Magento\Sales\Test\TestCase\MoveLastOrderedProductsOnOrderPageTest" summary="Add Products to Order from Last Ordered Products Section" ticketId="MAGETWO-27640">
<variation name="MoveLastOrderedProductsOnOrderPageTestVariation1">
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
<data name="order/dataset" xsi:type="string">default</data>
<data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default</data>
<constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />
</variation>
<variation name="MoveLastOrderedProductsOnOrderPageTestVariation2">
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
<data name="order/dataset" xsi:type="string">default</data>
<data name="order/data/entity_id/products" xsi:type="string">configurableProduct::configurable_with_qty_1</data>
<constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />
Expand Down

0 comments on commit c09e4af

Please sign in to comment.