|
| 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="NoOptionAvailableToConfigureDisabledProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="ConfigurableProduct"/> |
| 14 | + <stories value="Admin order configurable product"/> |
| 15 | + <title value="Disabled variation of configurable product can't be added to shopping cart via admin"/> |
| 16 | + <description value="Disabled variation of configurable product can't be added to shopping cart via admin"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="MC-17373"/> |
| 19 | + <useCaseId value="MAGETWO-72172"/> |
| 20 | + <group value="ConfigurableProduct"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 24 | + <!--Create category--> |
| 25 | + <comment userInput="Create category" stepKey="commentCreateCategory"/> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 27 | + <!-- Create the configurable product based on the data in the data folder --> |
| 28 | + <comment userInput="Create the configurable product based on the data in the data folder" stepKey="createConfigurableProduct"/> |
| 29 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + <!-- Create the configurable product with two options based on the default attribute set --> |
| 33 | + <comment userInput="Create the configurable product with two options based on the default attribute set" stepKey="configurableProductWithTwoOptions"/> |
| 34 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 35 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 36 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 37 | + </createData> |
| 38 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 39 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 40 | + </createData> |
| 41 | + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> |
| 42 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 43 | + </createData> |
| 44 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 45 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 46 | + </createData> |
| 47 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 48 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 49 | + </getData> |
| 50 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 51 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 52 | + </getData> |
| 53 | + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> |
| 54 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 55 | + </getData> |
| 56 | + <!-- Create the 3 children that will be a part of the configurable product --> |
| 57 | + <comment userInput="Create the 3 children that will be a part of the configurable product" stepKey="createTwoChildrenProducts"/> |
| 58 | + <createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1"> |
| 59 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 60 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 61 | + </createData> |
| 62 | + <createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2"> |
| 63 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 64 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 65 | + </createData> |
| 66 | + <createData entity="ApiSimpleProductWithPrice70" stepKey="createConfigChildProduct3"> |
| 67 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 68 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 69 | + </createData> |
| 70 | + <!-- Assign 3 products to the configurable product --> |
| 71 | + <comment userInput="Assign 3 products to the configurable product" stepKey="assignToConfigurableProduct"/> |
| 72 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> |
| 73 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 74 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 75 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 76 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 77 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 78 | + </createData> |
| 79 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 80 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 81 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 82 | + </createData> |
| 83 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 84 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 85 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 86 | + </createData> |
| 87 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> |
| 88 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 89 | + <requiredEntity createDataKey="createConfigChildProduct3"/> |
| 90 | + </createData> |
| 91 | + <!-- Create Customer --> |
| 92 | + <comment userInput="Create customer" stepKey="commentCreateCustomer"/> |
| 93 | + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> |
| 94 | + </before> |
| 95 | + <after> |
| 96 | + <!-- Delete created data --> |
| 97 | + <comment userInput="Delete created data" stepKey="deleteData"/> |
| 98 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory2"/> |
| 99 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 100 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> |
| 101 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> |
| 102 | + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> |
| 103 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 104 | + <deleteData createDataKey="createCustomer" stepKey="deleteCreatedCustomer"/> |
| 105 | + <actionGroup ref="logout" stepKey="logout"/> |
| 106 | + </after> |
| 107 | + <!-- Disable child product --> |
| 108 | + <comment userInput="Disable child product" stepKey="disableChildProduct"/> |
| 109 | + <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToEditPage"/> |
| 110 | + <waitForPageLoad stepKey="waitForChildProductPageLoad"/> |
| 111 | + <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> |
| 112 | + <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> |
| 113 | + <!-- Set the second product out of stock --> |
| 114 | + <comment userInput="Set the second product out of stock" stepKey="outOfStockChildProduct"/> |
| 115 | + <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToSecondProductEditPage"/> |
| 116 | + <waitForPageLoad stepKey="waitForSecondChildProductPageLoad"/> |
| 117 | + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="outOfStockStatus"/> |
| 118 | + <actionGroup ref="saveProductForm" stepKey="saveSecondProductForm"/> |
| 119 | + <!-- Go to created customer page --> |
| 120 | + <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> |
| 121 | + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> |
| 122 | + <argument name="customer" value="$$createCustomer$$"/> |
| 123 | + </actionGroup> |
| 124 | + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProduct"/> |
| 125 | + <waitForPageLoad stepKey="waitForProductsOpened"/> |
| 126 | + <!-- Find created configurable product and click on "Configure" link --> |
| 127 | + <comment userInput="Find created configurable product and click on Configure link" stepKey="goToConfigurableLink"/> |
| 128 | + <click selector="{{AdminOrderFormConfigureProductSection.configure($$createConfigProduct.id$$)}}" stepKey="clickOnConfigure"/> |
| 129 | + <!-- Click on attribute drop-down and check no option 1 is available --> |
| 130 | + <comment userInput="Click on attribute drop-down and check no option 1 is available" stepKey="commentNoOptionIsAvailable"/> |
| 131 | + <waitForElement selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="waitForShippingSectionLoaded"/> |
| 132 | + <click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickToSelectOption"/> |
| 133 | + <dontSee userInput="$$createConfigProductAttributeOption1.option[store_labels][1][label]$$" stepKey="dontSeeOption1"/> |
| 134 | + <!-- Go to created customer page again --> |
| 135 | + <comment userInput="Go to created customer page again" stepKey="goToCreatedCustomerPageAgain"/> |
| 136 | + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrderAgain"> |
| 137 | + <argument name="customer" value="$$createCustomer$$"/> |
| 138 | + </actionGroup> |
| 139 | + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProductAgain"/> |
| 140 | + <waitForPageLoad stepKey="waitForProductsOpenedAgain"/> |
| 141 | + <fillField selector="{{AdminOrderFormItemsSection.idFilter}}" userInput="$$createConfigChildProduct2.id$$" stepKey="idFilter"/> |
| 142 | + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> |
| 143 | + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> |
| 144 | + <!-- Add product to order --> |
| 145 | + <comment userInput="Add product to order" stepKey="addProductToOrder"/> |
| 146 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 147 | + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickToAddProductToOrder"/> |
| 148 | + <waitForPageLoad stepKey="waitForNewOrderPageLoad"/> |
| 149 | + <see userInput="This product is out of stock." stepKey="seeTheErrorMessageDisplayed"/> |
| 150 | + <!-- Select shipping method --> |
| 151 | + <comment userInput="Select shipping method" stepKey="selectShippingMethod"/> |
| 152 | + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> |
| 153 | + <waitForPageLoad stepKey="waitForShippingMethods"/> |
| 154 | + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> |
| 155 | + <waitForPageLoad stepKey="waitForShippingMethodLoad"/> |
| 156 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> |
| 157 | + <waitForPageLoad stepKey="waitForSuccess"/> |
| 158 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> |
| 159 | + </test> |
| 160 | +</tests> |
0 commit comments