| Current Path : /home/rtorresani/www/vendor/magento/module-bundle/Test/Mftf/Test/ |
| Current File : //home/rtorresani/www/vendor/magento/module-bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml |
<?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="StorefrontBundleCartTest">
<annotations>
<features value="Bundle"/>
<stories value="Bundle product details page"/>
<title value="Customer should not be able to add a Bundle Product to the cart without selecting options"/>
<description value="Customer should not be able to add a Bundle Product to the cart without selecting options"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-233"/>
<group value="Bundle"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
<!-- Start creating a bundle product -->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<!-- Add Option One, a "Drop-down" type option -->
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1">
<argument name="x" value="0"/>
<argument name="n" value="1"/>
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
<argument name="optionTitle" value="Option One"/>
<argument name="inputType" value="select"/>
</actionGroup>
<!-- Add Option Two, a "Radio Buttons" type option -->
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2">
<argument name="x" value="1"/>
<argument name="n" value="2"/>
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
<argument name="optionTitle" value="Option Two"/>
<argument name="inputType" value="radio"/>
</actionGroup>
<!-- Add Option Three, a "Checkbox" type option -->
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3">
<argument name="x" value="2"/>
<argument name="n" value="3"/>
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
<argument name="optionTitle" value="Option Three"/>
<argument name="inputType" value="checkbox"/>
</actionGroup>
<!-- Add Option Four, a "Multi Select" type option -->
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4">
<argument name="x" value="3"/>
<argument name="n" value="4"/>
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
<argument name="optionTitle" value="Option Four"/>
<argument name="inputType" value="multi"/>
</actionGroup>
<!-- Save product and go to storefront -->
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
<amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/>
<waitForPageLoad stepKey="waitForStorefront"/>
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/>
<!-- See validation errors for all 4 options -->
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart1"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error1"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error2"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error3"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error4"/>
<!-- Fill option 1, see validation errors for 3 other options -->
<selectOption selector="select.bundle-option-select" userInput="$$simpleProduct1.name$$ +$123.00" stepKey="selectOption1"/>
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart2"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error5"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error6"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error7"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error8"/>
<!-- Fill option 2, see validation errors for 2 other options -->
<click selector="input[type='radio']:nth-of-type(1)" stepKey="selectOption2"/>
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart3"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error9"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error10"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error11"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error12"/>
<!-- Fill option 3, see validation errors for 1 other options -->
<checkOption selector="input[type='checkbox']:nth-of-type(1)" stepKey="selectOption3"/>
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart4"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error13"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error14"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error15"/>
<see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error16"/>
<!-- Fill option 4, dont see any validation errors -->
<selectOption selector="select[multiple='multiple']" userInput="$$simpleProduct1.name$$ +$123.00" stepKey="selectOption4"/>
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart5"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error17"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error18"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error19"/>
<dontSee selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error20"/>
</test>
</tests>