Skip to content

Commit 0c87662

Browse files
committed
Refactoring-NewProductsListWidgetDownloadableProductTest
1 parent 9f7c4e6 commit 0c87662

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@
3636
<actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddDownloadableProduct">
3737
<argument name="productType" value="downloadable"/>
3838
</actionGroup>
39-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
40-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
41-
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{_defaultProduct.price}}" stepKey="fillProductPrice"/>
42-
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQuantity"/>
43-
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
44-
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
39+
<actionGroup ref="FillMainDownloadableProductFormActionGroup" stepKey="fillMainProductFormDownloadable">
40+
<argument name="product" value="_defaultProduct"/>
41+
</actionGroup>
42+
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
43+
<argument name="fromDate" value="01/1/2000"/>
44+
<argument name="toDate" value="01/1/2099"/>
45+
</actionGroup>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
4547
<click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="openDownloadableSection"/>
4648
<checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable"/>
4749
<fillField userInput="This Is A Title" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/>
@@ -55,9 +57,12 @@
5557
<!-- If PageCache is enabled, Cache clearing happens here, via merge -->
5658

5759
<!-- Check for product on the CMS page with the New Products widget -->
58-
59-
<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
60-
<waitForPageLoad stepKey="waitForCmsPage"/>
61-
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/>
60+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
61+
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
62+
</actionGroup>
63+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
64+
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
65+
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
66+
</actionGroup>
6267
</test>
6368
</tests>

0 commit comments

Comments
 (0)