|
| 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 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AddConfigurableProductToOrderFromShoppingCartTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Add Products to Order from Shopping Cart"/> |
| 15 | + <title value="Add configurable product to order from shopping cart test"/> |
| 16 | + <description value="Add configurable product to order from shopping cart"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-16008"/> |
| 19 | + <group value="sales"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create customer --> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 25 | + |
| 26 | + <!-- Create category --> |
| 27 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 28 | + |
| 29 | + <!-- Create configurable product --> |
| 30 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 31 | + <requiredEntity createDataKey="createCategory"/> |
| 32 | + </createData> |
| 33 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 34 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption"> |
| 35 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 36 | + </createData> |
| 37 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + </createData> |
| 40 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption"> |
| 41 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 42 | + </getData> |
| 43 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct"> |
| 44 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 45 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 46 | + <requiredEntity createDataKey="createCategory"/> |
| 47 | + </createData> |
| 48 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> |
| 49 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 50 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 51 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 52 | + </createData> |
| 53 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> |
| 54 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 55 | + <requiredEntity createDataKey="createConfigChildProduct"/> |
| 56 | + </createData> |
| 57 | + </before> |
| 58 | + <after> |
| 59 | + <!-- Admin log out --> |
| 60 | + <actionGroup ref="logout" stepKey="logout"/> |
| 61 | + |
| 62 | + <!-- Customer log out --> |
| 63 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 64 | + |
| 65 | + <!-- Delete customer --> |
| 66 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 67 | + |
| 68 | + <!-- Delete configurable product data --> |
| 69 | + <deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/> |
| 70 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 71 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 72 | + |
| 73 | + <!-- Delete category --> |
| 74 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 75 | + </after> |
| 76 | + |
| 77 | + <!-- Login as customer --> |
| 78 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 79 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 80 | + </actionGroup> |
| 81 | + |
| 82 | + <!-- Add configurable product to the cart --> |
| 83 | + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> |
| 84 | + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> |
| 85 | + <argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/> |
| 86 | + <argument name="productOption" value="$$getConfigAttributeOption.value$$"/> |
| 87 | + <argument name="qty" value="1"/> |
| 88 | + </actionGroup> |
| 89 | + |
| 90 | + <!-- Login as admin --> |
| 91 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 92 | + |
| 93 | + <!-- Search and open customer --> |
| 94 | + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> |
| 95 | + <argument name="email" value="$$createCustomer.email$$"/> |
| 96 | + </actionGroup> |
| 97 | + <click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickEditButton"/> |
| 98 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 99 | + |
| 100 | + <!-- Click create order --> |
| 101 | + <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> |
| 102 | + |
| 103 | + <!-- Check product in customer's activities in shopping cart section --> |
| 104 | + <see selector="{{AdminCustomerActivitiesShoppingCartSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInShoppingCartSection"/> |
| 105 | + <see selector="{{AdminCustomerActivitiesShoppingCartSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInShoppingCartSection"/> |
| 106 | + |
| 107 | + <!-- Click update changes --> |
| 108 | + <checkOption selector="{{AdminCustomerActivitiesShoppingCartSection.addToOrder}}" stepKey="checkOptionAddToOrder"/> |
| 109 | + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/> |
| 110 | + <waitForPageLoad stepKey="waitForOrderUpdating"/> |
| 111 | + |
| 112 | + <!-- Assert product in items ordered grid --> |
| 113 | + <see selector="{{AdminCustomerCreateNewOrderSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/> |
| 114 | + <see selector="{{AdminCustomerCreateNewOrderSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPrice"/> |
| 115 | + <seeInField selector="{{AdminCustomerCreateNewOrderSection.productQty}}" userInput="{{ApiSimpleSingleQty.quantity}}" stepKey="seeProductQty"/> |
| 116 | + </test> |
| 117 | +</tests> |
0 commit comments