Skip to content

Commit 722ddef

Browse files
committed
- working on the refactoring
1 parent 3b860f5 commit 722ddef

File tree

3 files changed

+76
-18
lines changed

3 files changed

+76
-18
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="StorefrontAssertProductAttributeLabelVisibleActionGroup">
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,15 @@
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="StorefrontAssertProductAttributeOptionVisibleActionGroup">
12+
13+
<seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOption"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,33 @@
8787
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
8888
</after>
8989
<!--Open Product in Store Front Page -->
90-
<amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/>
91-
<waitForPageLoad stepKey="waitForProductToLoad"/>
90+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront">
91+
<argument name="product" value="$createConfigProduct$"/>
92+
</actionGroup>
93+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad"/>
94+
9295
<!--Verify Product is visible and In Stock -->
93-
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/>
94-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/>
95-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInStoreFront"/>
96+
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage">
97+
<argument name="categoryName" value="$$createCategory.name$$"/>
98+
</actionGroup>
99+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront">
100+
<argument name="productName" value="$$createConfigProduct.name$$"/>
101+
</actionGroup>
102+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPriceInStoreFront">
103+
<argument name="productPrice" value="$$createConfigChildProduct1.price$$"/>
104+
</actionGroup>
96105
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront">
97106
<argument name="productSku" value="$$createConfigProduct.sku$$"/>
98107
</actionGroup>
99-
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/>
100-
<see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="seeProductAttributeLabel"/>
101-
<seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOptions"/>
108+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront">
109+
<argument name="productStockStatus" value="In Stock"/>
110+
</actionGroup>
111+
<!--<see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="seeProductAttributeLabel"/>-->
112+
<actionGroup ref="StorefrontAssertProductAttributeLabelVisibleActionGroup" stepKey="seeProductAttributeLabel">
113+
<argument name="productAttributeLabel" value="$$createConfigProductAttribute.default_value$$"/>
114+
</actionGroup>
115+
<!--<seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOptions"/>-->
116+
<actionGroup ref="StorefrontAssertProductAttributeOptionVisibleActionGroup" stepKey="seeProductAttributeOptions"/>
102117
<!-- Delete Child products -->
103118
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct">
104119
<argument name="sku" value="$$createConfigChildProduct1.sku$$"/>
@@ -107,21 +122,32 @@
107122
<argument name="sku" value="$$createConfigChildProduct2.sku$$"/>
108123
</actionGroup>
109124
<!--Verify product is not visible in category store front page -->
110-
<amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/>
111-
<waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
112-
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInStoreFrontPage"/>
113-
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickOnCategory"/>
114-
<dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProductInCategoryPage"/>
125+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openCategoryStoreFrontPage"/>
126+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageToLoad"/>
127+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCategoryInStoreFrontPage"/>
128+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnCategory"/>
129+
<actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="dontSeeProductInCategoryPage">
130+
<argument name="categoryUrlKey" value="$$createCategory.name$$"/>
131+
<argument name="productName" value="$$createConfigProduct.name$$"/>
132+
</actionGroup>
115133
<!--Open Product Store Front Page and Verify Product is Out Of Stock -->
116-
<amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront1"/>
117-
<waitForPageLoad stepKey="waitForProductToLoad1"/>
118-
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/>
119-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/>
134+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront1">
135+
<argument name="product" value="$createConfigProduct$"/>
136+
</actionGroup>
137+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad1"/>
138+
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage1">
139+
<argument name="categoryName" value="$$createCategory.name$$"/>
140+
</actionGroup>
141+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront1">
142+
<argument name="productName" value="$$createConfigProduct.name$$"/>
143+
</actionGroup>
120144
<dontSee selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="dontSeeProductPriceInStoreFront"/>
121145
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront1">
122146
<argument name="productSku" value="$$createConfigProduct.sku$$"/>
123147
</actionGroup>
124-
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="OUT OF STOCK" stepKey="seeProductStatusInStoreFront1"/>
148+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront1">
149+
<argument name="productStockStatus" value="OUT OF STOCK"/>
150+
</actionGroup>
125151
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="dontSeeProductAttributeLabel"/>
126152
<dontSeeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="dontSeeProductAttributeOptions"/>
127153
</test>

0 commit comments

Comments
 (0)