Skip to content

Commit 3822ca4

Browse files
committed
Merge branch 'MC-44' into RE-develop
2 parents 7f9a392 + e2c06ce commit 3822ca4

File tree

4 files changed

+170
-3
lines changed

4 files changed

+170
-3
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="stock" type="input" selector=".stock.available"/>
1313
<element name="productName" type="text" selector=".base"/>
1414
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
15+
<element name="productPriceLabel" type="text" selector=".price-label"/>
1516
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
1617
<element name="specialPrice" type="text" selector=".special-price"/>
1718
<element name="oldPrice" type="text" selector=".old-price"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="productAttributeTitle1" type="text" selector="#product-options-wrapper div[tabindex='0'] label"/>
1414
<element name="productAttributeOptions1" type="select" selector="#product-options-wrapper div[tabindex='0'] option"/>
1515
<element name="productAttributeOptionsSelectButton" type="select" selector="#product-options-wrapper .super-attribute-select"/>
16+
<element name="productAttributeOptionsError" type="text" selector="//div[@class='mage-error']"/>
1617
</section>
1718
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
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>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Test/StorefrontConfigurableProductViewTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<test name="StorefrontConfigurableProductGridViewTest">
1212
<annotations>
1313
<features value="ConfigurableProduct"/>
14-
<stories value="Storefront"/>
14+
<stories value="View configurable product in a category in storefront"/>
1515
<title value="customer should see the configurable product in the category grid"/>
1616
<description value="customer should see the configurable product in the category grid"/>
1717
<severity value="CRITICAL"/>
@@ -47,7 +47,7 @@
4747
<test name="StorefrontConfigurableProductListViewTest">
4848
<annotations>
4949
<features value="ConfigurableProduct"/>
50-
<stories value="Storefront"/>
50+
<stories value="View configurable product in a category in storefront"/>
5151
<title value="customer should see the configurable product in the category list"/>
5252
<description value="customer should see the configurable product in the category list"/>
5353
<severity value="CRITICAL"/>
@@ -85,7 +85,7 @@
8585
<test name="StorefrontConfigurableProductAddToCartTest">
8686
<annotations>
8787
<features value="ConfigurableProduct"/>
88-
<stories value="Storefront"/>
88+
<stories value="View configurable product in a category in storefront"/>
8989
<title value="customer should be taken to the product details page when clicking add to cart"/>
9090
<description value="customer should be taken to the product details page when clicking add to cart"/>
9191
<severity value="CRITICAL"/>

0 commit comments

Comments
 (0)