|
| 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="StorefrontConfigurableProductBasicInfoTest"> |
| 12 | + <annotations> |
| 13 | + <features value="ConfigurableProduct"/> |
| 14 | + <stories value="View configurable product details in storefront"/> |
| 15 | + <title value="Guest customer should see basic Configurable Product details"/> |
| 16 | + <description value="Guest customer should see basic Configurable Product details"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-77"/> |
| 19 | + <group value="ConfigurableProduct"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 24 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 25 | + |
| 26 | + <!-- Create a configurable product via the UI --> |
| 27 | + <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> |
| 28 | + <argument name="product" value="_defaultProduct"/> |
| 29 | + <argument name="category" value="$$createCategory$$"/> |
| 30 | + </actionGroup> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 35 | + </after> |
| 36 | + |
| 37 | + <!-- Verify configurable product details in storefront product view --> |
| 38 | + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> |
| 39 | + <waitForPageLoad stepKey="wait"/> |
| 40 | + <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> |
| 41 | + <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeProductSku"/> |
| 42 | + <see userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="seeProductPriceLabel"/> |
| 43 | + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="seeProductStockStatus"/> |
| 44 | + <see userInput="1.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/> |
| 45 | + <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeProductAttributeTitle"/> |
| 46 | + <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/> |
| 47 | + <see userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown1"/> |
| 48 | + <see userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown2"/> |
| 49 | + <see userInput="{{colorProductAttribute3.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown3"/> |
| 50 | + </test> |
| 51 | + |
| 52 | + <test name="StorefrontConfigurableProductOptionsTest"> |
| 53 | + <annotations> |
| 54 | + <features value="ConfigurableProduct"/> |
| 55 | + <stories value="View configurable product details in storefront"/> |
| 56 | + <title value="Guest customer should be able to see product configuration options"/> |
| 57 | + <description value="Guest customer should be able to see product configuration options"/> |
| 58 | + <severity value="MAJOR"/> |
| 59 | + <testCaseId value="MC-92"/> |
| 60 | + <group value="ConfigurableProduct"/> |
| 61 | + </annotations> |
| 62 | + |
| 63 | + <before> |
| 64 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 65 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 66 | + |
| 67 | + <!-- Create a configurable product via the UI --> |
| 68 | + <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> |
| 69 | + <argument name="product" value="_defaultProduct"/> |
| 70 | + <argument name="category" value="$$createCategory$$"/> |
| 71 | + </actionGroup> |
| 72 | + </before> |
| 73 | + <after> |
| 74 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 75 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 76 | + </after> |
| 77 | + |
| 78 | + <!-- Verify configurable product options in storefront product view --> |
| 79 | + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> |
| 80 | + <waitForPageLoad stepKey="wait"/> |
| 81 | + <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> |
| 82 | + <selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> |
| 83 | + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> |
| 84 | + <see userInput="1.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice1"/> |
| 85 | + <selectOption userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> |
| 86 | + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> |
| 87 | + <see userInput="2.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> |
| 88 | + <selectOption userInput="{{colorProductAttribute3.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption3"/> |
| 89 | + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel3"/> |
| 90 | + <see userInput="3.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice3"/> |
| 91 | + </test> |
| 92 | + |
| 93 | + <test name="StorefrontConfigurableProductCanAddToCartTest"> |
| 94 | + <annotations> |
| 95 | + <features value="ConfigurableProduct"/> |
| 96 | + <stories value="View configurable product details in storefront"/> |
| 97 | + <title value="Guest customer should be able to successfully add the product to the cart"/> |
| 98 | + <description value="Guest customer should be able to successfully add the product to the cart"/> |
| 99 | + <severity value="MAJOR"/> |
| 100 | + <testCaseId value="MC-97"/> |
| 101 | + <group value="ConfigurableProduct"/> |
| 102 | + </annotations> |
| 103 | + |
| 104 | + <before> |
| 105 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 106 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 107 | + |
| 108 | + <!-- Create a configurable product via the UI --> |
| 109 | + <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> |
| 110 | + <argument name="product" value="_defaultProduct"/> |
| 111 | + <argument name="category" value="$$createCategory$$"/> |
| 112 | + </actionGroup> |
| 113 | + </before> |
| 114 | + <after> |
| 115 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 116 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 117 | + </after> |
| 118 | + |
| 119 | + <!-- Verify adding configurable product to cart after an option is selected in storefront product view --> |
| 120 | + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> |
| 121 | + <waitForPageLoad stepKey="wait"/> |
| 122 | + <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> |
| 123 | + <selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> |
| 124 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> |
| 125 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 126 | + <argument name="product" value="_defaultProduct"/> |
| 127 | + <argument name="productCount" value="1"/> |
| 128 | + </actionGroup> |
| 129 | + </test> |
| 130 | + |
| 131 | + <test name="StorefrontConfigurableProductCantAddToCartTest"> |
| 132 | + <annotations> |
| 133 | + <features value="ConfigurableProduct"/> |
| 134 | + <stories value="View configurable product details in storefront"/> |
| 135 | + <title value="Guest customer should not be able to add the product to the cart if options are not selected"/> |
| 136 | + <description value="Guest customer should not be able to add the product to the cart if options are not selected"/> |
| 137 | + <severity value="MAJOR"/> |
| 138 | + <testCaseId value="MC-81"/> |
| 139 | + <group value="ConfigurableProduct"/> |
| 140 | + </annotations> |
| 141 | + |
| 142 | + <before> |
| 143 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 144 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 145 | + |
| 146 | + <!-- Create a configurable product via the UI --> |
| 147 | + <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> |
| 148 | + <argument name="product" value="_defaultProduct"/> |
| 149 | + <argument name="category" value="$$createCategory$$"/> |
| 150 | + </actionGroup> |
| 151 | + </before> |
| 152 | + <after> |
| 153 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 154 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 155 | + </after> |
| 156 | + |
| 157 | + <!-- Verify not able to add configurable product to cart when no option is selected in storefront product view --> |
| 158 | + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> |
| 159 | + <waitForPageLoad stepKey="wait"/> |
| 160 | + <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> |
| 161 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> |
| 162 | + <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart" /> |
| 163 | + <see userInput="This is a required field" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsError}}" stepKey="seeError"/> |
| 164 | + </test> |
| 165 | +</tests> |
0 commit comments