|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCreateOrderWithSelectedShoppingCartItemsTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Shopping cart items must not be added to the order unless they were moved manually"/> |
| 13 | + <stories value="MC-17838: Shopping cart items added to the order created in the admin"/> |
| 14 | + <description value="Shopping cart items must not be added to the order unless they were moved manually"/> |
| 15 | + <features value="Sales"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <group value="Sales"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!--Set default flat rate shipping method settings--> |
| 21 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 22 | + |
| 23 | + <!--Create customer--> |
| 24 | + <createData entity="Simple_US_CA_Customer" stepKey="simpleCustomer"/> |
| 25 | + |
| 26 | + <!--Create category--> |
| 27 | + <createData entity="_defaultCategory" stepKey="category1"/> |
| 28 | + |
| 29 | + <!--Create product1--> |
| 30 | + <createData entity="_defaultProduct" stepKey="product1"> |
| 31 | + <requiredEntity createDataKey="category1"/> |
| 32 | + </createData> |
| 33 | + |
| 34 | + <!--Create product2--> |
| 35 | + <createData entity="_defaultProduct" stepKey="product2"> |
| 36 | + <requiredEntity createDataKey="category1"/> |
| 37 | + </createData> |
| 38 | + |
| 39 | + <!--Login as admin--> |
| 40 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 41 | + </before> |
| 42 | + |
| 43 | + <!-- Step 1: Go to Storefront as Customer --> |
| 44 | + <actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin"> |
| 45 | + <argument name="customer" value="$$simpleCustomer$$" /> |
| 46 | + </actionGroup> |
| 47 | + |
| 48 | + <!-- Step 2: Add product to cart --> |
| 49 | + <amOnPage url="{{StorefrontProductPage.url($$product1.custom_attributes[url_key]$)}}" stepKey="amOnPage"/> |
| 50 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 51 | + <argument name="product" value="$$product1$$"/> |
| 52 | + <argument name="productCount" value="1"/> |
| 53 | + </actionGroup> |
| 54 | + |
| 55 | + <!--Step 3: Create new customer order--> |
| 56 | + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> |
| 57 | + <argument name="customer" value="$$simpleCustomer$$"/> |
| 58 | + </actionGroup> |
| 59 | + |
| 60 | + <!--Step 4: Add product2 to the order--> |
| 61 | + <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> |
| 62 | + <argument name="product" value="$$product2$$"/> |
| 63 | + </actionGroup> |
| 64 | + |
| 65 | + <!--Step 5: Select product1 in the shopping cart--> |
| 66 | + <click selector="{{AdminOrderFormShoppingCartSection.addProduct($$product1.name$$)}}" stepKey="selectProduct1InTheShoppingCart"/> |
| 67 | + |
| 68 | + <!--Step 6: Select FlatRate shipping method--> |
| 69 | + <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> |
| 70 | + |
| 71 | + <!--Step 7: Submit order--> |
| 72 | + <actionGroup ref="SubmitOrderActionGroup" stepKey="submitOrder"/> |
| 73 | + |
| 74 | + <!--Step 8: Verify order information--> |
| 75 | + <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> |
| 76 | + |
| 77 | + <!--Step 9: Check that product 2 is in the order items list --> |
| 78 | + <actionGroup ref="seeProductInItemsOrdered" stepKey="seeProduct2InItemsOrdered"> |
| 79 | + <argument name="product" value="$$product2$$"/> |
| 80 | + </actionGroup> |
| 81 | + |
| 82 | + <!--Step 10: Check that product 1 is not in the order items list --> |
| 83 | + <actionGroup ref="dontSeeProductInItemsOrdered" stepKey="dontSeeProduct1InItemsOrdered"> |
| 84 | + <argument name="product" value="$$product1$$"/> |
| 85 | + </actionGroup> |
| 86 | + <after> |
| 87 | + <!--Delete product1--> |
| 88 | + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> |
| 89 | + |
| 90 | + <!--Delete product2--> |
| 91 | + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> |
| 92 | + |
| 93 | + <!--Delete category--> |
| 94 | + <deleteData createDataKey="category1" stepKey="deleteCategory1"/> |
| 95 | + |
| 96 | + <!--Delete customer--> |
| 97 | + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> |
| 98 | + |
| 99 | + <!--Logout--> |
| 100 | + <actionGroup ref="logout" stepKey="logout"/> |
| 101 | + </after> |
| 102 | + </test> |
| 103 | +</tests> |
0 commit comments