Skip to content

Commit 6cfe41b

Browse files
committed
Refactoring the test
1 parent 52ce622 commit 6cfe41b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

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

4040
<!-- Verify adding configurable product to cart after an option is selected 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-
<selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/>
41+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
42+
<argument name="productUrlKey" 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="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1">
49+
<argument name="attributeLabel" value="{{colorProductAttribute.default_label}}"/>
50+
<argument name="optionLabel" value="{{colorProductAttribute1.name}}"/>
51+
</actionGroup>
4552
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/>
4653
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
4754
<argument name="product" value="_defaultProduct"/>

0 commit comments

Comments
 (0)