|
| 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="StorefrontCustomerReorderProductWithCustomOptionsTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Reorder product with custom options"/> |
| 13 | + <title value="Make reorder as customer on frontend"/> |
| 14 | + <description value="Make reorder as customer on Frontend with simple product custom options"/> |
| 15 | + <severity value="CRITICAL"/> |
| 16 | + <testCaseId value="MC-42899"/> |
| 17 | + <useCaseId value="MC-41981" /> |
| 18 | + <group value="sales"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <!-- Login As Admin --> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + <!-- Create Customer --> |
| 25 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 26 | + <!-- Create Simple Category --> |
| 27 | + <createData entity="_defaultCategory" stepKey="initialCategoryEntity"/> |
| 28 | + <!-- Create Simple Product --> |
| 29 | + <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"/> |
| 30 | + </before> |
| 31 | + |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 34 | + <deleteData createDataKey="initialCategoryEntity" stepKey="deleteDefaultCategory"/> |
| 35 | + <deleteData createDataKey="initialSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 36 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 37 | + </after> |
| 38 | + |
| 39 | + <!-- Search default simple product in the grid --> |
| 40 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> |
| 41 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> |
| 42 | + <argument name="product" value="$$initialSimpleProduct$$"/> |
| 43 | + </actionGroup> |
| 44 | + |
| 45 | + <!-- Open custom option panel --> |
| 46 | + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomizableOptions"/> |
| 47 | + <waitForPageLoad stepKey="waitForCustomOptionsOpen"/> |
| 48 | + |
| 49 | + <!-- Add First Drop Down Custom Options --> |
| 50 | + <actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomDropDownOptionFirst"> |
| 51 | + <argument name="customOptionTitle" value="{{ProductOptionDropDown.title}}"/> |
| 52 | + <argument name="customOptionType" value="Drop-down"/> |
| 53 | + </actionGroup> |
| 54 | + <actionGroup ref="AdminAddTitleAndPriceValueToCustomOptionActionGroup" stepKey="addTitleAndPriceValueToCustomDropDownOptionFirst"> |
| 55 | + <argument name="optionValue" value="ProductOptionValueDropdown1"/> |
| 56 | + </actionGroup> |
| 57 | + |
| 58 | + <!-- Add Custom file option --> |
| 59 | + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="addFileOption"> |
| 60 | + <argument name="option" value="ProductOptionFile"/> |
| 61 | + </actionGroup> |
| 62 | + |
| 63 | + <!-- Add Second Drop Down Custom Options --> |
| 64 | + <!-- As per issue both drop-down are fixed valued so used again ProductOptionValueDropdown1 DataEntity --> |
| 65 | + <actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomDropDownOptionSecond"> |
| 66 | + <argument name="customOptionTitle" value="{{ProductOptionDropDownWithLongValuesTitle.title}}"/> |
| 67 | + <argument name="customOptionType" value="Drop-down"/> |
| 68 | + </actionGroup> |
| 69 | + <actionGroup ref="AdminAddTitleAndPriceValueToCustomOptionActionGroup" stepKey="addTitleAndPriceValueToCustomDropDownOptionSecond"> |
| 70 | + <argument name="optionValue" value="ProductOptionValueDropdown2"/> |
| 71 | + </actionGroup> |
| 72 | + |
| 73 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 74 | + |
| 75 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 76 | + |
| 77 | + <!-- Login to storefront as Customer --> |
| 78 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 79 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 80 | + </actionGroup> |
| 81 | + |
| 82 | + <!-- Place Order as Customer --> |
| 83 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 84 | + <argument name="productUrl" value="$$initialSimpleProduct.custom_attributes[url_key]$$"/> |
| 85 | + </actionGroup> |
| 86 | + |
| 87 | + <!-- Select Option From First DropDown option --> |
| 88 | + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOption"> |
| 89 | + <argument name="attributeLabel" value="{{ProductOptionDropDown.title}}"/> |
| 90 | + <argument name="optionLabel" value="{{ProductOptionValueDropdown1.title}}"/> |
| 91 | + </actionGroup> |
| 92 | + |
| 93 | + <!-- Attach file option --> |
| 94 | + <actionGroup ref="StorefrontAttachOptionFileActionGroup" stepKey="selectAndAttachFile"/> |
| 95 | + |
| 96 | + <!-- Select Option From Second DropDown option --> |
| 97 | + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectSecondOption"> |
| 98 | + <argument name="attributeLabel" value="{{ProductOptionDropDownWithLongValuesTitle.title}}"/> |
| 99 | + <argument name="optionLabel" value="{{ProductOptionValueDropdown2.title}}"/> |
| 100 | + </actionGroup> |
| 101 | + |
| 102 | + <!-- Add Product to Card --> |
| 103 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 104 | + <argument name="product" value="$$initialSimpleProduct$$"/> |
| 105 | + <argument name="productCount" value="1"/> |
| 106 | + </actionGroup> |
| 107 | + |
| 108 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/> |
| 109 | + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> |
| 110 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 111 | + |
| 112 | + <!-- Log out from storefront as Customer --> |
| 113 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogOut"/> |
| 114 | + |
| 115 | + <!-- Again Login As Admin --> |
| 116 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminForSubmitShipment"/> |
| 117 | + |
| 118 | + <!-- Open order --> |
| 119 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderForCreatingShipment"> |
| 120 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 121 | + </actionGroup> |
| 122 | + |
| 123 | + <!-- Create Shipment for the order --> |
| 124 | + <actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="startCreateShipment"/> |
| 125 | + <actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/> |
| 126 | + |
| 127 | + <!-- Login to storefront as Customer for Reorder --> |
| 128 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLoginForReorder"> |
| 129 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 130 | + </actionGroup> |
| 131 | + |
| 132 | + <!-- Make reorder --> |
| 133 | + <actionGroup ref="StorefrontCustomerReorderActionGroup" stepKey="makeReorder"> |
| 134 | + <argument name="orderNumber" value="{$grabOrderNumber}"/> |
| 135 | + </actionGroup> |
| 136 | + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeReorder"/> |
| 137 | + </test> |
| 138 | +</tests> |
0 commit comments