Skip to content

Commit 63e5e8d

Browse files
ENGCOM-8707: Refactoring StorefrontConfigurableProductBasicInfoTest #31827
- Merge Pull Request #31827 from kate-kyzyma/magento2:Refactoring-StorefrontConfigurableProductBasicInfoTest - Merged commits: 1. b4db970 2. 09f63c0 3. c74c888 4. 4708c00
2 parents cd857f9 + 4708c00 commit 63e5e8d

File tree

3 files changed

+63
-11
lines changed

3 files changed

+63
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductAttributeLabelVisibleActionGroup">
12+
<arguments>
13+
<argument name="productAttributeLabel" type="string"/>
14+
</arguments>
15+
<see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{productAttributeLabel}}" stepKey="seeProductAttributeLabel"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductAttributeOptionVisibleActionGroup">
12+
<arguments>
13+
<argument name="productAttributeOption" type="string"/>
14+
</arguments>
15+
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{productAttributeOption}}" stepKey="seeProductAttributeOption"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,35 @@
3838
</after>
3939

4040
<!-- Verify configurable product details in storefront product view -->
41-
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/>
42-
<waitForPageLoad stepKey="wait"/>
43-
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/>
44-
<see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeProductSku"/>
41+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnConfigurableProductPage">
42+
<argument name="productUrl" value="{{_defaultProduct.urlKey}}"/>
43+
</actionGroup>
44+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait"/>
45+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductName">
46+
<argument name="productName" value="{{_defaultProduct.name}}"/>
47+
</actionGroup>
48+
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku">
49+
<argument name="productSku" value="{{_defaultProduct.sku}}"/>
50+
</actionGroup>
4551
<see userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="seeProductPriceLabel"/>
46-
<see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="seeProductStockStatus"/>
47-
<see userInput="1.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/>
48-
<see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeProductAttributeTitle"/>
49-
<see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/>
50-
<see userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown1"/>
51-
<see userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown2"/>
52-
<see userInput="{{colorProductAttribute3.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown3"/>
52+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStockStatus">
53+
<argument name="productStockStatus" value="In Stock"/>
54+
</actionGroup>
55+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPrice">
56+
<argument name="productPrice" value="1.00"/>
57+
</actionGroup>
58+
<actionGroup ref="AssertStorefrontProductAttributeLabelVisibleActionGroup" stepKey="seeProductAttributeTitle">
59+
<argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/>
60+
</actionGroup>
61+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeColorAttributeName1"/>
62+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown1">
63+
<argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/>
64+
</actionGroup>
65+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2">
66+
<argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/>
67+
</actionGroup>
68+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3">
69+
<argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/>
70+
</actionGroup>
5371
</test>
5472
</tests>

0 commit comments

Comments
 (0)