-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4925 from magento-epam/MAGETWO-72172-v2
- fixed Disabled variation of configurable product can be added to shopping cart via admin
- Loading branch information
Showing
6 changed files
with
182 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
...to/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="NoOptionAvailableToConfigureDisabledProductTest"> | ||
<annotations> | ||
<features value="ConfigurableProduct"/> | ||
<stories value="Admin order configurable product"/> | ||
<title value="Disabled variation of configurable product can't be added to shopping cart via admin"/> | ||
<description value="Disabled variation of configurable product can't be added to shopping cart via admin"/> | ||
<severity value="AVERAGE"/> | ||
<testCaseId value="MC-17373"/> | ||
<useCaseId value="MAGETWO-72172"/> | ||
<group value="ConfigurableProduct"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="LoginAsAdmin" stepKey="login"/> | ||
<!--Create category--> | ||
<comment userInput="Create category" stepKey="commentCreateCategory"/> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
<!-- Create the configurable product based on the data in the data folder --> | ||
<comment userInput="Create the configurable product based on the data in the data folder" stepKey="createConfigurableProduct"/> | ||
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
<!-- Create the configurable product with two options based on the default attribute set --> | ||
<comment userInput="Create the configurable product with two options based on the default attribute set" stepKey="configurableProductWithTwoOptions"/> | ||
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> | ||
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</createData> | ||
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</createData> | ||
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</createData> | ||
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</createData> | ||
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</getData> | ||
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</getData> | ||
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
</getData> | ||
<!-- Create the 3 children that will be a part of the configurable product --> | ||
<comment userInput="Create the 3 children that will be a part of the configurable product" stepKey="createTwoChildrenProducts"/> | ||
<createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
</createData> | ||
<createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption2"/> | ||
</createData> | ||
<createData entity="ApiSimpleProductWithPrice70" stepKey="createConfigChildProduct3"> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption3"/> | ||
</createData> | ||
<!-- Assign 3 products to the configurable product --> | ||
<comment userInput="Assign 3 products to the configurable product" stepKey="assignToConfigurableProduct"/> | ||
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> | ||
<requiredEntity createDataKey="createConfigProduct"/> | ||
<requiredEntity createDataKey="createConfigProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption2"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption3"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> | ||
<requiredEntity createDataKey="createConfigProduct"/> | ||
<requiredEntity createDataKey="createConfigChildProduct1"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> | ||
<requiredEntity createDataKey="createConfigProduct"/> | ||
<requiredEntity createDataKey="createConfigChildProduct2"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> | ||
<requiredEntity createDataKey="createConfigProduct"/> | ||
<requiredEntity createDataKey="createConfigChildProduct3"/> | ||
</createData> | ||
<!-- Create Customer --> | ||
<comment userInput="Create customer" stepKey="commentCreateCustomer"/> | ||
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> | ||
</before> | ||
<after> | ||
<!-- Delete created data --> | ||
<comment userInput="Delete created data" stepKey="deleteData"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory2"/> | ||
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> | ||
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> | ||
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> | ||
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> | ||
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCreatedCustomer"/> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
<!-- Disable child product --> | ||
<comment userInput="Disable child product" stepKey="disableChildProduct"/> | ||
<amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToEditPage"/> | ||
<waitForPageLoad stepKey="waitForChildProductPageLoad"/> | ||
<click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> | ||
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/> | ||
<!-- Set the second product out of stock --> | ||
<comment userInput="Set the second product out of stock" stepKey="outOfStockChildProduct"/> | ||
<amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToSecondProductEditPage"/> | ||
<waitForPageLoad stepKey="waitForSecondChildProductPageLoad"/> | ||
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="outOfStockStatus"/> | ||
<actionGroup ref="saveProductForm" stepKey="saveSecondProductForm"/> | ||
<!-- Go to created customer page --> | ||
<comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> | ||
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProduct"/> | ||
<waitForPageLoad stepKey="waitForProductsOpened"/> | ||
<!-- Find created configurable product and click on "Configure" link --> | ||
<comment userInput="Find created configurable product and click on Configure link" stepKey="goToConfigurableLink"/> | ||
<click selector="{{AdminOrderFormConfigureProductSection.configure($$createConfigProduct.id$$)}}" stepKey="clickOnConfigure"/> | ||
<!-- Click on attribute drop-down and check no option 1 is available --> | ||
<comment userInput="Click on attribute drop-down and check no option 1 is available" stepKey="commentNoOptionIsAvailable"/> | ||
<waitForElement selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="waitForShippingSectionLoaded"/> | ||
<click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickToSelectOption"/> | ||
<dontSee userInput="$$createConfigProductAttributeOption1.option[store_labels][1][label]$$" stepKey="dontSeeOption1"/> | ||
<!-- Go to created customer page again --> | ||
<comment userInput="Go to created customer page again" stepKey="goToCreatedCustomerPageAgain"/> | ||
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrderAgain"> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProductAgain"/> | ||
<waitForPageLoad stepKey="waitForProductsOpenedAgain"/> | ||
<fillField selector="{{AdminOrderFormItemsSection.idFilter}}" userInput="$$createConfigChildProduct2.id$$" stepKey="idFilter"/> | ||
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> | ||
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> | ||
<!-- Add product to order --> | ||
<comment userInput="Add product to order" stepKey="addProductToOrder"/> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickToAddProductToOrder"/> | ||
<waitForPageLoad stepKey="waitForNewOrderPageLoad"/> | ||
<see userInput="This product is out of stock." stepKey="seeTheErrorMessageDisplayed"/> | ||
<!-- Select shipping method --> | ||
<comment userInput="Select shipping method" stepKey="selectShippingMethod"/> | ||
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> | ||
<waitForPageLoad stepKey="waitForShippingMethods"/> | ||
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> | ||
<waitForPageLoad stepKey="waitForShippingMethodLoad"/> | ||
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> | ||
<waitForPageLoad stepKey="waitForSuccess"/> | ||
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters