|
| 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="MoveRecentlyViewedConfigurableProductOnOrderPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Add Products to Order from Recently Viewed Products Section"/> |
| 15 | + <title value="Move recently viewed configurable product on order page test"/> |
| 16 | + <description value="Move recently viewed configurable product on order page"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-16163"/> |
| 19 | + <group value="sales"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Login as admin --> |
| 24 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 25 | + |
| 26 | + <!-- Create customer --> |
| 27 | + <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> |
| 28 | + |
| 29 | + <!-- Create category --> |
| 30 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 31 | + |
| 32 | + <!-- Create configurable product --> |
| 33 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 34 | + <requiredEntity createDataKey="createCategory"/> |
| 35 | + </createData> |
| 36 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 37 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + </createData> |
| 40 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 41 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 42 | + </createData> |
| 43 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption"> |
| 44 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 45 | + </getData> |
| 46 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct"> |
| 47 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 48 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 49 | + <requiredEntity createDataKey="createCategory"/> |
| 50 | + </createData> |
| 51 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> |
| 52 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 53 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 54 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 55 | + </createData> |
| 56 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> |
| 57 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 58 | + <requiredEntity createDataKey="createConfigChildProduct"/> |
| 59 | + </createData> |
| 60 | + </before> |
| 61 | + <after> |
| 62 | + <!-- Admin logout --> |
| 63 | + <actionGroup ref="logout" stepKey="logout"/> |
| 64 | + |
| 65 | + <!-- Customer logout --> |
| 66 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 67 | + |
| 68 | + <!-- Delete customer --> |
| 69 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 70 | + |
| 71 | + <!-- Delete created data --> |
| 72 | + <deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/> |
| 73 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 74 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 75 | + |
| 76 | + <!-- Delete category --> |
| 77 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 78 | + </after> |
| 79 | + |
| 80 | + <!-- Login as customer --> |
| 81 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 82 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <!-- Go to created product page --> |
| 86 | + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> |
| 87 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 88 | + <selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption.value$$" stepKey="selectOption"/> |
| 89 | + |
| 90 | + <!-- Search and open customer --> |
| 91 | + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> |
| 92 | + <argument name="email" value="$$createCustomer.email$$"/> |
| 93 | + </actionGroup> |
| 94 | + <click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickEditButton"/> |
| 95 | + <waitForPageLoad stepKey="waitForCustomerPageLoad"/> |
| 96 | + |
| 97 | + <!-- Click create order --> |
| 98 | + <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> |
| 99 | + |
| 100 | + <!-- Add configure to product --> |
| 101 | + <click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure($$createConfigProduct.name$$)}}" stepKey="configureProduct"/> |
| 102 | + <selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="$$getConfigAttributeOption.value$$" stepKey="selectProductOption"/> |
| 103 | + <click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtn"/> |
| 104 | + <waitForPageLoad stepKey="waitForProductConfigureLoad"/> |
| 105 | + |
| 106 | + <!-- Click 'Update Changes' --> |
| 107 | + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/> |
| 108 | + |
| 109 | + <!-- Assert products in items ordered grid --> |
| 110 | + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/> |
| 111 | + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeProductPrice"/> |
| 112 | + </test> |
| 113 | +</tests> |
0 commit comments