Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace repetitive actions with Action Groups in ProductsListWidgetTest #32714

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@
<actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddBundleProduct">
<argument name="productType" value="bundle"/>
</actionGroup>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>

<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName">
<argument name="product" value="_defaultProduct"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
<argument name="fromDate" value="01/1/2000"/>
<argument name="toDate" value="01/1/2099"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
<!-- and then configure bundled items for this product -->

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

<!-- Check for product on the CMS page with the New Products widget -->

<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
<waitForPageLoad stepKey="waitForCmsPage"/>
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/>
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSetProductAsNewDateActionGroup">
<arguments>
<argument name="fromDate" type="string"/>
<argument name="toDate" type="string"/>
</arguments>

<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="{{fromDate}}" stepKey="fillProductNewFrom"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="{{toDate}}" stepKey="fillProductNewTo"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,27 @@

<!-- Create a Simple Product to appear in the widget -->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductList"/>
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{_defaultProduct.price}}" stepKey="fillProductPrice"/>
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQuantity"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="clickAddProduct"/>
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductName"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductPrice"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductQuantity"/>
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
<argument name="fromDate" value="01/1/2000"/>
<argument name="toDate" value="01/1/2099"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveProduct"/>

<!-- If PageCache is enabled, Cache clearing happens here via merge -->

<!-- Check for product on the CMS page with the New Products widget -->
<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
<waitForPageLoad stepKey="waitForCmsPage"/>
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/>
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCmsPageSetUrlActionGroup">
<arguments>
<argument name="urlKey" type="string"/>
</arguments>

<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{urlKey}}" stepKey="fillPageUrlKey"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminExpandContentSectionActionGroup">
<annotations>
<description>Expand Content section on the Admin CMS Page creation/edit.</description>
</annotations>
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="expandContentSection"/>
<waitForPageLoad stepKey="waitForContentSection"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminExpandSeoSectionActionGroup">
<annotations>
<description>Expand SEO section on the Admin CMS Page creation/edit.</description>
</annotations>
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="expandSeoSection"/>
<waitForPageLoad stepKey="waitForSeoSection"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductIsShownOnCmsPageActionGroup">
<arguments>
<argument name="cmsTitle" type="string"/>
<argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/>
</arguments>

<seeInTitle userInput="{{cmsTitle}}" stepKey="seePageTitle"/>
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{productName}}" stepKey="seeProductName"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,23 @@
<argument name="productId" value="$$createConfigProduct.id$$"/>
</actionGroup>
<waitForPageLoad stepKey="waitForEditPage"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
<argument name="fromDate" value="01/1/2000"/>
<argument name="toDate" value="01/1/2099"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveProduct"/>

<!-- If PageCache is enabled, Cache clearing happens here, via merge -->

<!-- Check for product on the CMS page with the New Products widget -->
<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
<waitForPageLoad stepKey="waitForCmsPage"/>
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/>
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
<argument name="productName" value="$$createConfigProduct.name$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@
<actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddDownloadableProduct">
<argument name="productType" value="downloadable"/>
</actionGroup>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{_defaultProduct.price}}" stepKey="fillProductPrice"/>
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQuantity"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
<actionGroup ref="FillMainDownloadableProductFormActionGroup" stepKey="fillProductName">
<argument name="product" value="_defaultProduct"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductPrice"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductQuantity"/>
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
<argument name="fromDate" value="01/1/2000"/>
<argument name="toDate" value="01/1/2099"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
<click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="openDownloadableSection"/>
<checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable"/>
<fillField userInput="This Is A Title" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/>
Expand All @@ -55,9 +60,12 @@
<!-- If PageCache is enabled, Cache clearing happens here, via merge -->

<!-- Check for product on the CMS page with the New Products widget -->

<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
<waitForPageLoad stepKey="waitForCmsPage"/>
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/>
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@
<actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddGroupedProduct">
<argument name="productType" value="grouped"/>
</actionGroup>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/>
<fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/>
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName">
<argument name="product" value="_defaultProduct"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
<actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom">
<argument name="fromDate" value="01/1/2000"/>
<argument name="toDate" value="01/1/2099"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/>
<conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/>
<scrollTo selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="scrollToAddProductsToGroup"/>
<click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/>
Expand All @@ -64,9 +69,12 @@
<!-- If PageCache is enabled, Cache clearing happens here, via merge -->

<!-- Check for product on the CMS page with the New Products widget -->

<amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/>
<waitForPageLoad stepKey="waitForCmsPage"/>
<see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/>
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage">
<argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/>
<actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName">
<argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminInsertCatalogNewProductListWidgetForCmsPageContentSectionActionGroup">
<annotations>
<description>Insert "Catalog New Product List" Widget into Content Section of CMS page</description>
</annotations>
<arguments>
<argument name="displayType" type="string" defaultValue="All products"/>
<argument name="numberOfProductsToDisplay" type="string"/>
<argument name="displayPageControl" type="string" defaultValue="No"/>
<argument name="template" type="string" defaultValue="New Products Grid Template"/>
<argument name="cacheLifetime" type="string" defaultValue=""/>
</arguments>
<click selector="{{CmsWYSIWYGSection.InsertWidgetBtn}}" stepKey="clickInsertWidgetButton"/>
<waitForPageLoad stepKey="waitForSlideOut"/>
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog New Products List" stepKey="selectWidgetType"/>
<waitForPageLoad stepKey="waitForWidgetOptions"/>
<selectOption selector="{{WidgetSection.DisplayType}}" userInput="{{displayType}}" stepKey="selectDisplayType"/>
<selectOption selector="{{AdminNewWidgetSection.displayPageControl}}" userInput="{{displayPageControl}}" stepKey="selectDisplayPageControl"/>
<fillField selector="{{AdminNewWidgetSection.numberOfProductsToDisplay}}" userInput="{{numberOfProductsToDisplay}}" stepKey="fillNumberOfProductsToDisplay"/>
<selectOption selector="{{AdminNewWidgetSection.template}}" userInput="{{template}}" stepKey="selectTemplate"/>
<fillField selector="{{AdminNewWidgetSection.cacheLifetime}}" userInput="{{cacheLifetime}}" stepKey="fillCacheLifetime"/>
</actionGroup>
</actionGroups>
Loading