Skip to content

Commit 07bc24f

Browse files
committed
Refactoring NewProductsListWidgetBundleProductTest
1 parent b5c06d7 commit 07bc24f

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@
4040
<actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddBundleProduct">
4141
<argument name="productType" value="bundle"/>
4242
</actionGroup>
43-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
44-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
45-
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
46-
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
47-
43+
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName">
44+
<argument name="product" value="_defaultProduct"/>
45+
</actionGroup>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
47+
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
48+
<argument name="fromDate" value="01/1/2000"/>
49+
<argument name="toDate" value="01/1/2099"/>
50+
</actionGroup>
51+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
4852
<!-- and then configure bundled items for this product -->
4953

5054
<scrollTo selector="{{AdminProductFormBundleSection.addOption}}" stepKey="scrollToAddOptionButton"/>
@@ -69,9 +73,12 @@
6973
<!-- If PageCache is enabled, Cache clearing happens here, via merge -->
7074

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

0 commit comments

Comments
 (0)