|
| 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="StorefrontValidateQuantityBundleProductsTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Bundle"/> |
| 13 | + <stories value="Bundle product details page"/> |
| 14 | + <title value="Validation for negative quantity on bundle products."/> |
| 15 | + <description value="Customer should not be able to add the products to the cart if the quantity is negative value"/> |
| 16 | + <severity value="MINOR"/> |
| 17 | + <testCaseId value="MC-42765"/> |
| 18 | + <group value="Bundle"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 22 | + <createData entity="SimpleProduct2" stepKey="createProduct1"/> |
| 23 | + <createData entity="SimpleProduct2" stepKey="createProduct2"/> |
| 24 | + <magentoCron stepKey="runCronIndex" groups="index"/> |
| 25 | + </before> |
| 26 | + <after> |
| 27 | + <!-- Delete the bundled product --> |
| 28 | + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> |
| 29 | + <argument name="product" value="BundleProduct"/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 32 | + <deleteData createDataKey="createProduct1" stepKey="deleteSimpleProduct1"/> |
| 33 | + <deleteData createDataKey="createProduct2" stepKey="deleteSimpleProduct2"/> |
| 34 | + </after> |
| 35 | + |
| 36 | + <!-- Start creating a bundle product --> |
| 37 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/> |
| 38 | + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> |
| 39 | + <argument name="product" value="BundleProduct"/> |
| 40 | + </actionGroup> |
| 41 | + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> |
| 42 | + <argument name="product" value="BundleProduct"/> |
| 43 | + </actionGroup> |
| 44 | + |
| 45 | + <!-- Add Option One, a "Drop-down" type option --> |
| 46 | + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> |
| 47 | + <argument name="x" value="0"/> |
| 48 | + <argument name="n" value="1"/> |
| 49 | + <argument name="prodOneSku" value="$$createProduct1.sku$$"/> |
| 50 | + <argument name="prodTwoSku" value="$$createProduct2.sku$$"/> |
| 51 | + <argument name="optionTitle" value="Option One"/> |
| 52 | + <argument name="inputType" value="select"/> |
| 53 | + </actionGroup> |
| 54 | + <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '0')}}" stepKey="userDefinedQuantitiyOption0Product0"/> |
| 55 | + <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '1')}}" stepKey="userDefinedQuantitiyOption0Product1"/> |
| 56 | + |
| 57 | + <!-- Add Option Two, a "Radio Buttons" type option --> |
| 58 | + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> |
| 59 | + <argument name="x" value="1"/> |
| 60 | + <argument name="n" value="2"/> |
| 61 | + <argument name="prodOneSku" value="$$createProduct1.sku$$"/> |
| 62 | + <argument name="prodTwoSku" value="$$createProduct2.sku$$"/> |
| 63 | + <argument name="optionTitle" value="Option Two"/> |
| 64 | + <argument name="inputType" value="radio"/> |
| 65 | + </actionGroup> |
| 66 | + <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('1', '0')}}" stepKey="userDefinedQuantitiyOption1Product0"/> |
| 67 | + <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('1', '1')}}" stepKey="userDefinedQuantitiyOption1Product1"/> |
| 68 | + |
| 69 | + <!-- Save product and go to storefront --> |
| 70 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 71 | + |
| 72 | + <wait stepKey="waitBeforeIndexerAfterBundle" time="60"/> |
| 73 | + <magentoCLI command="cron:run --group=index" stepKey="runCronIndexerAfterBundle"/> |
| 74 | + |
| 75 | + <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> |
| 76 | + <waitForPageLoad stepKey="waitForStorefront"/> |
| 77 | + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> |
| 78 | + |
| 79 | + <!--"Drop-down" type option--> |
| 80 | + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$createProduct1.name$$ +$$$createProduct1.price$$.00" stepKey="selectOption0Product0"/> |
| 81 | + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$createProduct1.name$$ +$$$createProduct1.price$$.00" stepKey="checkOption0Product0"/> |
| 82 | + <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="-1" stepKey="fillQuantity00"/> |
| 83 | + <seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="-1" stepKey="checkQuantity00"/> |
| 84 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCartDropDown"/> |
| 85 | + <see selector="{{StorefrontBundledSection.dropDownQuantityValidation('Option One')}}" userInput="Please enter a quantity greater than 0." stepKey="seeQuantityNegativeErrorMessageDropDown"/> |
| 86 | + |
| 87 | + <!--"Radio Buttons" type option--> |
| 88 | + <checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '1')}}" stepKey="selectOption1Product0"/> |
| 89 | + <seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '1')}}" stepKey="checkOption1Product0"/> |
| 90 | + <fillField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="-1" stepKey="fillQuantity10"/> |
| 91 | + <seeInField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="-1" stepKey="checkQuantity10"/> |
| 92 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCartRadioButton"/> |
| 93 | + <see selector="{{StorefrontBundledSection.radioButtonQuantityValidation('Option Two')}}" userInput="Please enter a quantity greater than 0." stepKey="seeQuantityNegativeErrorMessageRadioButton"/> |
| 94 | + </test> |
| 95 | +</tests> |
0 commit comments