Skip to content

Commit e22f98a

Browse files
committed
Refactoring NewProductsListWidgetGroupedProductTest
1 parent 07bc24f commit e22f98a

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@
4545
<actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddGroupedProduct">
4646
<argument name="productType" value="grouped"/>
4747
</actionGroup>
48-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
49-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
50-
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
51-
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
48+
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName">
49+
<argument name="product" value="_defaultProduct"/>
50+
</actionGroup>
51+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
52+
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
53+
<argument name="fromDate" value="01/1/2000"/>
54+
<argument name="toDate" value="01/1/2099"/>
55+
</actionGroup>
56+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
57+
5258
<conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/>
5359
<scrollTo selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="scrollToAddProductsToGroup"/>
5460
<click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/>
@@ -64,9 +70,12 @@
6470
<!-- If PageCache is enabled, Cache clearing happens here, via merge -->
6571

6672
<!-- Check for product on the CMS page with the New Products widget -->
67-
68-
<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
69-
<waitForPageLoad stepKey="waitForCmsPage"/>
70-
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/>
73+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
74+
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
75+
</actionGroup>
76+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
77+
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
78+
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
79+
</actionGroup>
7180
</test>
7281
</tests>

0 commit comments

Comments
 (0)