|
| 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="MoveConfigurableProductsInComparedOnOrderPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Add Products to Order from Products in Comparison List Section"/> |
| 15 | + <title value="Move configurable products in compared on order page test"/> |
| 16 | + <description value="Move configurable products in compared on order page test"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-16104"/> |
| 19 | + <group value="sales"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create customer --> |
| 24 | + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> |
| 25 | + |
| 26 | + <!-- Create category --> |
| 27 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 28 | + |
| 29 | + <!-- Create first configurable product --> |
| 30 | + <createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct"> |
| 31 | + <requiredEntity createDataKey="createCategory"/> |
| 32 | + </createData> |
| 33 | + <createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/> |
| 34 | + <createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeOption"> |
| 35 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 36 | + </createData> |
| 37 | + <createData entity="AddToDefaultSet" stepKey="createFirstConfigAddToAttributeSet"> |
| 38 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 39 | + </createData> |
| 40 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeOption"> |
| 41 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 42 | + </getData> |
| 43 | + <createData entity="ApiSimpleOne" stepKey="createFirstConfigChildProduct"> |
| 44 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 45 | + <requiredEntity createDataKey="getFirstConfigAttributeOption"/> |
| 46 | + <requiredEntity createDataKey="createCategory"/> |
| 47 | + </createData> |
| 48 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createFirstConfigProductOption"> |
| 49 | + <requiredEntity createDataKey="createFirstConfigProduct"/> |
| 50 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 51 | + <requiredEntity createDataKey="getFirstConfigAttributeOption"/> |
| 52 | + </createData> |
| 53 | + <createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddChild"> |
| 54 | + <requiredEntity createDataKey="createFirstConfigProduct"/> |
| 55 | + <requiredEntity createDataKey="createFirstConfigChildProduct"/> |
| 56 | + </createData> |
| 57 | + |
| 58 | + <!-- Create second configurable product --> |
| 59 | + <createData entity="ApiConfigurableProduct" stepKey="createSecondConfigProduct"> |
| 60 | + <requiredEntity createDataKey="createCategory"/> |
| 61 | + </createData> |
| 62 | + <createData entity="productAttributeWithTwoOptions" stepKey="createSecondConfigProductAttribute"/> |
| 63 | + <createData entity="productAttributeOption1" stepKey="createSecondConfigProductAttributeOption"> |
| 64 | + <requiredEntity createDataKey="createSecondConfigProductAttribute"/> |
| 65 | + </createData> |
| 66 | + <createData entity="AddToDefaultSet" stepKey="createSecondConfigAddToAttributeSet"> |
| 67 | + <requiredEntity createDataKey="createSecondConfigProductAttribute"/> |
| 68 | + </createData> |
| 69 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getSecondConfigAttributeOption"> |
| 70 | + <requiredEntity createDataKey="createSecondConfigProductAttribute"/> |
| 71 | + </getData> |
| 72 | + <createData entity="ApiSimpleOne" stepKey="createSecondConfigChildProduct"> |
| 73 | + <requiredEntity createDataKey="createSecondConfigProductAttribute"/> |
| 74 | + <requiredEntity createDataKey="getSecondConfigAttributeOption"/> |
| 75 | + <requiredEntity createDataKey="createCategory"/> |
| 76 | + </createData> |
| 77 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createSecondConfigProductOption"> |
| 78 | + <requiredEntity createDataKey="createSecondConfigProduct"/> |
| 79 | + <requiredEntity createDataKey="createSecondConfigProductAttribute"/> |
| 80 | + <requiredEntity createDataKey="getSecondConfigAttributeOption"/> |
| 81 | + </createData> |
| 82 | + <createData entity="ConfigurableProductAddChild" stepKey="createSecondConfigProductAddChild"> |
| 83 | + <requiredEntity createDataKey="createSecondConfigProduct"/> |
| 84 | + <requiredEntity createDataKey="createSecondConfigChildProduct"/> |
| 85 | + </createData> |
| 86 | + </before> |
| 87 | + <after> |
| 88 | + <!-- Admin logout --> |
| 89 | + <actionGroup ref="logout" stepKey="logout"/> |
| 90 | + |
| 91 | + <!-- Logout customer --> |
| 92 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 93 | + |
| 94 | + <!-- Delete configurable products data --> |
| 95 | + <deleteData createDataKey="createFirstConfigChildProduct" stepKey="deleteFirstConfigChildProduct"/> |
| 96 | + <deleteData createDataKey="createFirstConfigProduct" stepKey="deleteFirstConfigProduct"/> |
| 97 | + <deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/> |
| 98 | + <deleteData createDataKey="createSecondConfigChildProduct" stepKey="deleteSecondConfigChildProduct"/> |
| 99 | + <deleteData createDataKey="createSecondConfigProduct" stepKey="deleteSecondConfigProduct"/> |
| 100 | + <deleteData createDataKey="createSecondConfigProductAttribute" stepKey="deleteSecondConfigProductAttribute"/> |
| 101 | + |
| 102 | + <!-- Delete category --> |
| 103 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 104 | + </after> |
| 105 | + |
| 106 | + <!-- Login as customer --> |
| 107 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 108 | + <argument name="Customer" value="$$createCustomer$$" /> |
| 109 | + </actionGroup> |
| 110 | + |
| 111 | + <!-- Add first product to compare list --> |
| 112 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openFirstProductPage"> |
| 113 | + <argument name="productUrl" value="$$createFirstConfigProduct.custom_attributes[url_key]$$"/> |
| 114 | + </actionGroup> |
| 115 | + <scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton"/> |
| 116 | + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addFirstProductToCompare"> |
| 117 | + <argument name="productVar" value="$$createFirstConfigProduct$$"/> |
| 118 | + </actionGroup> |
| 119 | + |
| 120 | + <!-- Add second product to compare list --> |
| 121 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage"> |
| 122 | + <argument name="productUrl" value="$$createSecondConfigProduct.custom_attributes[url_key]$$"/> |
| 123 | + </actionGroup> |
| 124 | + <scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductBtn"/> |
| 125 | + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addSecondProductToCompare"> |
| 126 | + <argument name="productVar" value="$$createSecondConfigProduct$$"/> |
| 127 | + </actionGroup> |
| 128 | + |
| 129 | + <!-- Login as admin --> |
| 130 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 131 | + |
| 132 | + <!-- Open Customers -> All Customers --> |
| 133 | + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> |
| 134 | + <waitForPageLoad stepKey="waitForCustomerPageLoad"/> |
| 135 | + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> |
| 136 | + <argument name="customer" value="$$createCustomer$$"/> |
| 137 | + </actionGroup> |
| 138 | + |
| 139 | + <!-- Click 'Create Order' --> |
| 140 | + <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> |
| 141 | + |
| 142 | + <!-- Add configure to first product --> |
| 143 | + <click selector="{{AdminCustomerActivitiesComparisonListSection.addToOrderConfigure($$createFirstConfigProduct.name$$)}}" stepKey="configureFirstProduct"/> |
| 144 | + <selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="$$getFirstConfigAttributeOption.value$$" stepKey="selectOptionForFirstProduct"/> |
| 145 | + <click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtnForFirstProduct"/> |
| 146 | + <waitForPageLoad stepKey="waitForConfigureForFirstProductLoad"/> |
| 147 | + |
| 148 | + <!-- Add configure to second product --> |
| 149 | + <click selector="{{AdminCustomerActivitiesComparisonListSection.addToOrderConfigure($$createSecondConfigProduct.name$$)}}" stepKey="configureSecondProduct"/> |
| 150 | + <selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="$$getSecondConfigAttributeOption.value$$" stepKey="selectOptionForSecond"/> |
| 151 | + <click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtnForSecondProduct"/> |
| 152 | + <waitForPageLoad stepKey="waitForConfigureForSecondProductLoad"/> |
| 153 | + |
| 154 | + <!-- Click 'Update Changes' --> |
| 155 | + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/> |
| 156 | + |
| 157 | + <!-- Assert products in items ordered grid --> |
| 158 | + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createFirstConfigProduct.name$$" stepKey="seeFirstProductName"/> |
| 159 | + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeFirstProductPrice"/> |
| 160 | + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Product')}}" userInput="$$createSecondConfigProduct.name$$" stepKey="seeSecondProductName"/> |
| 161 | + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Price')}}" userInput="$123.00" stepKey="seeSecondProductPrice"/> |
| 162 | + </test> |
| 163 | +</tests> |
0 commit comments