-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #125 from magento-pangolin/MC-4770
MC-4770
- Loading branch information
Showing
7 changed files
with
256 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
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
15 changes: 15 additions & 0 deletions
15
app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.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,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="AdminCreateOrderShoppingCartSection"> | ||
<element name="shoppingCartBlock" type="text" selector="#sidebar_data_cart"/> | ||
<element name="addToOrderCheckBox" type="checkbox" selector="//div[@id='order-sidebar_cart']//tr[td[.='{{productName}}']]//input[contains(@name,'sidebar[add_cart_item]')]" parameterized="true" timeout="30"/> | ||
</section> | ||
</sections> |
16 changes: 16 additions & 0 deletions
16
app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.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,16 @@ | ||
<?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="AdminCreateOrderWishListSection"> | ||
<element name="wishListBlock" type="text" selector="#sidebar_data_wishlist"/> | ||
<element name="addProductToOrderCheckBox" type="checkbox" selector="//div[@id='order-sidebar_wishlist']//tr[td[.='{{productName}}']]//input[contains(@name,'sidebar[add_wishlist_item]')]" parameterized="true" timeout="30"/> | ||
<element name="addConfigProductToOrder" type="text" selector="//div[@id='order-sidebar_wishlist']//tr[td[contains(.,'{{configProductName}}')]]//a[contains(@class, 'icon-configure')]" parameterized="true" timeout="30"/> | ||
</section> | ||
</sections> |
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
212 changes: 212 additions & 0 deletions
212
app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.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,212 @@ | ||
<?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="CreateOrderFromEditCustomerPageTest"> | ||
<annotations> | ||
<group value="Sales"/> | ||
<stories value="Create Order"/> | ||
<title value="Create order from edit customer page and add products to wish list and shopping cart"/> | ||
<description value="Create an order from edit customer page and add products to the wish list and shopping cart "/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-16161"/> | ||
<group value="mtf_migrated"/> | ||
<group value="banana"/> | ||
</annotations> | ||
|
||
<before> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> | ||
|
||
<!--Create simple customer--> | ||
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> | ||
|
||
<!-- Create Simple Product --> | ||
<createData entity="SimpleProduct2" stepKey="simpleProduct"> | ||
<field key="price">10.00</field> | ||
</createData> | ||
<createData entity="SimpleProduct2" stepKey="simpleProduct1"> | ||
<field key="price">20.00</field> | ||
</createData> | ||
|
||
<!-- Create configurable product and add it to the category --> | ||
<createData entity="ApiCategory" stepKey="createCategory"/> | ||
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<!-- Create an attribute with two options to be used in the first child product --> | ||
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> | ||
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</createData> | ||
|
||
<!-- Add the attribute we just created to default attribute set --> | ||
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</createData> | ||
|
||
<!-- Get the option of the attribute we created --> | ||
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</getData> | ||
|
||
<!-- Create a simple product and give it the attribute with option --> | ||
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
<field key="price">30.00</field> | ||
</createData> | ||
|
||
<!-- Create the configurable product --> | ||
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> | ||
<requiredEntity createDataKey="createConfigProduct"/> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
</createData> | ||
|
||
<!-- Add simple product to the configurable product --> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> | ||
<requiredEntity createDataKey="createConfigProduct"/> | ||
<requiredEntity createDataKey="createConfigChildProduct1"/> | ||
</createData> | ||
<magentoCLI command="indexer:reindex" stepKey="reindex"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
</before> | ||
<after> | ||
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> | ||
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> | ||
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> | ||
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> | ||
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct"/> | ||
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigurableProduct"/> | ||
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!--Filter and Open the customer edit page --> | ||
<actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterTheCustomer"> | ||
<argument name="email" value="$$simpleCustomer.email$$"/> | ||
</actionGroup> | ||
<click selector="{{AdminCustomerGridSection.customerEditLinkByEmail($$simpleCustomer.email$$)}}" stepKey="clickOnEditButton"/> | ||
<waitForPageLoad stepKey="waitForCustomerEditPageToLoad"/> | ||
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickOnCreateOrderButton"/> | ||
<waitForPageLoad stepKey="waitForOrderPageToLoad"/> | ||
|
||
<!--Add configurable product to order--> | ||
<actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> | ||
<argument name="product" value="$$createConfigProduct$$"/> | ||
<argument name="attribute" value="$$createConfigProductAttribute$$"/> | ||
<argument name="option" value="$$getConfigAttributeOption1$$"/> | ||
</actionGroup> | ||
|
||
<!--Add Simple product to order--> | ||
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> | ||
<argument name="product" value="$$simpleProduct$$"/> | ||
</actionGroup> | ||
|
||
<!--Add Second Simple product to order--> | ||
<actionGroup ref="addSimpleProductToOrder" stepKey="addSecondSimpleProductToOrder"> | ||
<argument name="product" value="$$simpleProduct1$$"/> | ||
</actionGroup> | ||
|
||
<!-- Move Products to the WishList --> | ||
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveProductToWishList"/> | ||
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$createConfigProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveConfigurableProductToWishList"/> | ||
<click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItemsAndQuantity"/> | ||
<waitForPageLoad stepKey="waitForAdminCreateOrderWishListSectionPageLoad"/> | ||
|
||
<!-- Assert products in Wish List section --> | ||
<see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList"/> | ||
<see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList"/> | ||
|
||
<!-- Add products to order from Wish List --> | ||
<waitForElementVisible selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="waitForCheckBoxToVisible"/> | ||
<click selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectProductToAddToOrder"/> | ||
<click selector="{{AdminCreateOrderWishListSection.addConfigProductToOrder($$createConfigProduct.name$$)}}" stepKey="AddConfigurableProductToOrder"/> | ||
<waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" stepKey="waitForConfigurablePopover"/> | ||
<selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectConfigurableOption"/> | ||
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> | ||
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/> | ||
<waitForPageLoad stepKey="waitForAdminOrderItemsOrderedSectionPageLoad1"/> | ||
|
||
<!-- Assert Products in Order item section --> | ||
<see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigProductInOrderItemGrid"/> | ||
|
||
<!-- Move Products to the Shopping Cart --> | ||
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Shopping Cart" stepKey="moveFirstSimpleProductToShoppingCart"/> | ||
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct1.name$$)}}" userInput="Move to Shopping Cart" stepKey="moveSecondSimpleProductToShoppingCart"/> | ||
<click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItems"/> | ||
<waitForPageLoad stepKey="waitForAdminCreateOrderShoppingCartSectionPageLoad"/> | ||
|
||
<!-- Assert products in Shopping cart section --> | ||
<see selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeProductInShoppingCart"/> | ||
<see selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct1.name$$" stepKey="seeSecondProductInShoppingCart"/> | ||
|
||
<!-- Move products to the order from shopping cart --> | ||
<waitForElementVisible selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="waitForAddToOrderCheckBox"/> | ||
<click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectFirstProduct"/> | ||
<click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct1.name$$)}}" stepKey="selectSecondProduct"/> | ||
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton1"/> | ||
<waitForPageLoad stepKey="waitForAdminCreateOrderShoppingCartSectionPageLoad1"/> | ||
|
||
<!-- After move, assert products are not present in Shopping cart section --> | ||
<dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="donSeeProductInShoppingCart"/> | ||
<dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct1.name$$" stepKey="dontSeeSecondProductInShoppingCart"/> | ||
|
||
<!-- After move, assert products are present in Wish List section --> | ||
<see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList1"/> | ||
<see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList1"/> | ||
|
||
<!-- After move, assert products are present in order items section --> | ||
<see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid1"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigProductInOrderItemGrid1"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct1.name$$" stepKey="seeSecondProductInOrderItemGrid1"/> | ||
|
||
<!-- Select Free Shipping --> | ||
<waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="waitForShippingSection"/> | ||
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> | ||
<waitForPageLoad stepKey="waitForShippingMethods"/> | ||
<click selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="chooseShippingMethod"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad"/> | ||
|
||
<!-- Submit order --> | ||
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> | ||
<waitForPageLoad stepKey="waitForAdminOrderFormLoad"/> | ||
|
||
<!-- Verify order information --> | ||
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> | ||
<grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> | ||
|
||
<!-- Filter and Open the customer edit page --> | ||
<actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterTheCustomer1"> | ||
<argument name="email" value="$$simpleCustomer.email$$"/> | ||
</actionGroup> | ||
<click selector="{{AdminCustomerGridSection.customerEditLinkByEmail($$simpleCustomer.email$$)}}" stepKey="clickOnEditButton1"/> | ||
<waitForPageLoad stepKey="waitForCustomerEditPageToLoad1"/> | ||
<click selector="{{AdminEditCustomerInformationSection.orders}}" stepKey="clickOnOrdersButton"/> | ||
<waitForPageLoad stepKey="waitForOrderPageToOpen"/> | ||
<click selector="{{AdminEditCustomerOrdersSection.orderIdInGrid('$orderId')}}" stepKey="selectOnOrderID"/> | ||
|
||
<!-- Assert ordered product in customer order section--> | ||
<waitForPageLoad stepKey="waitForOrderInformationToLoad"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$createConfigProduct.name$" stepKey="seeConfigurableProductInGrid"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$simpleProduct.name$" stepKey="seeFirstProductInGrid"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$simpleProduct1.name$" stepKey="seeSecondProductInGrid"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.statusColumn}}" userInput="{{OrderStatus.ordered}}" stepKey="seeProductStatus"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$createConfigChildProduct1.price$" stepKey="seeConfigurableProductSubtotal"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$simpleProduct.price$" stepKey="seeFirstProductSubtotal"/> | ||
<see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$simpleProduct1.price$" stepKey="seeSecondProductSubtotal"/> | ||
<see selector="{{AdminOrderTotalSection.subTotal}}" userInput="{{AdminOrderMultipleProducts.subtotal}}" stepKey="checkSubtotal" /> | ||
<see selector="{{AdminOrderTotalSection.shippingAndHandling}}" userInput="{{AdminOrderMultipleProducts.shipping}}" stepKey="checkShippingAndHandling" /> | ||
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="{{AdminOrderMultipleProducts.grandTotal}}" stepKey="checkGrandTotal" /> | ||
</test> | ||
</tests> |
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