|
| 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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontBundleCartTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Bundle"/> |
| 14 | + <stories value="Bundle product details page"/> |
| 15 | + <title value="Customer should not be able to add the product to the cart without to select customisable bundle product options"/> |
| 16 | + <description value="Customer should not be able to add the product to the cart without to select customisable bundle product options"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-233"/> |
| 19 | + <group value="Bundle"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 23 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> |
| 24 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> |
| 25 | + </before> |
| 26 | + <after> |
| 27 | + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/> |
| 28 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 29 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 30 | + </after> |
| 31 | + |
| 32 | + <!-- Start creating a bundle product --> |
| 33 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> |
| 34 | + <waitForPageLoad stepKey="waitForProductList"/> |
| 35 | + <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> |
| 36 | + <argument name="product" value="BundleProduct"/> |
| 37 | + </actionGroup> |
| 38 | + <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> |
| 39 | + <argument name="product" value="BundleProduct"/> |
| 40 | + </actionGroup> |
| 41 | + |
| 42 | + <!-- Add Option One, a "Drop-down" type option --> |
| 43 | + <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> |
| 44 | + <argument name="x" value="0"/> |
| 45 | + <argument name="n" value="1"/> |
| 46 | + <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> |
| 47 | + <argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/> |
| 48 | + <argument name="optionTitle" value="Option One"/> |
| 49 | + <argument name="inputType" value="select"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Add Option Two, a "Radio Buttons" type option --> |
| 53 | + <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> |
| 54 | + <argument name="x" value="1"/> |
| 55 | + <argument name="n" value="2"/> |
| 56 | + <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> |
| 57 | + <argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/> |
| 58 | + <argument name="optionTitle" value="Option Two"/> |
| 59 | + <argument name="inputType" value="radio"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <!-- Add Option Three, a "Checkbox" type option --> |
| 63 | + <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> |
| 64 | + <argument name="x" value="2"/> |
| 65 | + <argument name="n" value="3"/> |
| 66 | + <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> |
| 67 | + <argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/> |
| 68 | + <argument name="optionTitle" value="Option Three"/> |
| 69 | + <argument name="inputType" value="checkbox"/> |
| 70 | + </actionGroup> |
| 71 | + |
| 72 | + <!-- Add Option Four, a "Multi Select" type option --> |
| 73 | + <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> |
| 74 | + <argument name="x" value="3"/> |
| 75 | + <argument name="n" value="4"/> |
| 76 | + <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> |
| 77 | + <argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/> |
| 78 | + <argument name="optionTitle" value="Option Four"/> |
| 79 | + <argument name="inputType" value="multi"/> |
| 80 | + </actionGroup> |
| 81 | + |
| 82 | + <!-- Save product and go to storefront --> |
| 83 | + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> |
| 84 | + <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> |
| 85 | + <waitForPageLoad stepKey="waitForStorefront"/> |
| 86 | + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> |
| 87 | + |
| 88 | + <!-- See validation errors for all 4 options --> |
| 89 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart1"/> |
| 90 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error1"/> |
| 91 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error2"/> |
| 92 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error3"/> |
| 93 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error4"/> |
| 94 | + |
| 95 | + <!-- Fill option 1, see validation errors for 3 other options --> |
| 96 | + <selectOption selector="select.bundle-option-select" userInput="$$simpleProduct1.name$$ +$123.00" stepKey="selectOption1"/> |
| 97 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart2"/> |
| 98 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error5"/> |
| 99 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error6"/> |
| 100 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error7"/> |
| 101 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error8"/> |
| 102 | + |
| 103 | + <!-- Fill option 2, see validation errors for 2 other options --> |
| 104 | + <click selector="input[type='radio']:nth-of-type(1)" stepKey="selectOption2"/> |
| 105 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart3"/> |
| 106 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error9"/> |
| 107 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error10"/> |
| 108 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error11"/> |
| 109 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error12"/> |
| 110 | + |
| 111 | + <!-- Fill option 3, see validation errors for 1 other options --> |
| 112 | + <checkOption selector="input[type='checkbox']:nth-of-type(1)" stepKey="selectOption3"/> |
| 113 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart4"/> |
| 114 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error13"/> |
| 115 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error14"/> |
| 116 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error15"/> |
| 117 | + <see selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error16"/> |
| 118 | + |
| 119 | + <!-- Fill option 4, dont see any validation errors --> |
| 120 | + <selectOption selector="select[multiple='multiple']" userInput="$$simpleProduct1.name$$ +$123.00" stepKey="selectOption4"/> |
| 121 | + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCart5"/> |
| 122 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" userInput="This is a required field." stepKey="error17"/> |
| 123 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" userInput="Please select one of the options." stepKey="error18"/> |
| 124 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('3')}}" userInput="Please select one of the options." stepKey="error19"/> |
| 125 | + <dontSee selector="{{StorefrontBundledSection.nthOptionDiv('4')}}" userInput="This is a required field." stepKey="error20"/> |
| 126 | + </test> |
| 127 | +</tests> |
0 commit comments