Skip to content

Commit b1ff2c3

Browse files
committed
Updating the test
1 parent 8010e79 commit b1ff2c3

File tree

6 files changed

+105
-12
lines changed

6 files changed

+105
-12
lines changed
Lines changed: 17 additions & 0 deletions
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCmsPageSetUrlActionGroup">
11+
<arguments>
12+
<argument name="urlKey" type="string"/>
13+
</arguments>
14+
15+
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{urlKey}}" stepKey="fillPageUrlKey"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AdminExpandContentSectionActionGroup">
12+
<annotations>
13+
<description>Expand Content section on the Admin CMS Page creation/edit.</description>
14+
</annotations>
15+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="expandContentSection"/>
16+
<waitForPageLoad stepKey="waitForSeoSection"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AdminExpandSeoSectionActionGroup">
12+
<annotations>
13+
<description>Expand SEO section on the Admin CMS Page creation/edit.</description>
14+
</annotations>
15+
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="expandSeoSection"/>
16+
<waitForPageLoad stepKey="waitForContentSection"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="AdminInsertCatalogNewProductListWidgetForCmsPageContentSectionActionGroup">
12+
<annotations>
13+
<description>Insert "Catalog New Product List" Widget into Content Section of CMS page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="displayType" type="string" defaultValue="All products"/>
17+
<argument name="numberOfProductsToDisplay" type="string"/>
18+
<argument name="displayPageControl" type="string" defaultValue="No"/>
19+
<argument name="template" type="string" defaultValue="New Products Grid Template"/>
20+
<argument name="cacheLifetime" type="string" defaultValue=""/>
21+
</arguments>
22+
<click selector="{{CmsWYSIWYGSection.InsertWidgetBtn}}" stepKey="clickInsertWidgetButton"/>
23+
<waitForPageLoad stepKey="waitForSlideOut"/>
24+
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog New Products List" stepKey="selectWidgetType"/>
25+
<waitForPageLoad stepKey="waitForWidgetOptions"/>
26+
<selectOption selector="{{WidgetSection.DisplayType}}" userInput="{{displayType}}" stepKey="selectDisplayType"/>
27+
<selectOption selector="{{AdminNewWidgetSection.displayPageControl}}" userInput="{{displayPageControl}}" stepKey="selectDisplayPageControl"/>
28+
<fillField selector="{{AdminNewWidgetSection.numberOfProductsToDisplay}}" userInput="{{numberOfProductsToDisplay}}" stepKey="fillNumberOfProductsToDisplay"/>
29+
<selectOption selector="{{AdminNewWidgetSection.template}}" userInput="{{template}}" stepKey="selectTemplate"/>
30+
<fillField selector="{{AdminNewWidgetSection.cacheLifetime}}" userInput="{{cacheLifetime}}" stepKey="fillCacheLifetime"/>
31+
</actionGroup>
32+
</actionGroups>

app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<element name="title" type="input" selector="[name='parameters[title]']"/>
5454
<element name="displayPageControl" type="select" selector="[name='parameters[show_pager]']"/>
5555
<element name="numberOfProductsToDisplay" type="input" selector="[name='parameters[products_count]']"/>
56+
<element name="template" type="select" selector="[name='parameters[template]']"/>
5657
<element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/>
5758
<element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/>
5859
<element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/>

app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,25 @@
3434
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnCmsList"/>
3535
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsList"/>
3636
<actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPageButton"/>
37-
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_newDefaultCmsPage.title}}" stepKey="fillPageTitle"/>
38-
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="expandContentSection"/>
39-
<waitForPageLoad stepKey="waitForContentSection"/>
40-
<click selector="{{CmsWYSIWYGSection.InsertWidgetBtn}}" stepKey="clickInsertWidgetButton"/>
41-
<waitForPageLoad stepKey="waitForSlideOut"/>
42-
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog New Products List" stepKey="selectWidgetType"/>
43-
<waitForPageLoad stepKey="waitForWidgetOptions"/>
44-
<selectOption selector="{{WidgetSection.DisplayType}}" userInput="New products" stepKey="selectDisplayType"/>
45-
<fillField selector="{{WidgetSection.NoOfProductToDisplay}}" userInput="100" stepKey="fillNoOfProductToDisplay"/>
37+
<actionGroup ref="AdminCmsPageSetTitleActionGroup" stepKey="fillPageTitle">
38+
<argument name="newTitle" value="{{_newDefaultCmsPage.title}}"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminExpandContentSectionActionGroup" stepKey="expandContentSection"/>
41+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForContentSection"/>
42+
<actionGroup ref="AdminInsertCatalogNewProductListWidgetForCmsPageContentSectionActionGroup" stepKey="clickInsertWidgetButton">
43+
<argument name="displayType" value="New products"/>
44+
<argument name="numberOfProductsToDisplay" value="100"/>
45+
</actionGroup>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOut"/>
47+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectWidgetType"/>
48+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForWidgetOptions"/>
49+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectDisplayType"/>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillNoOfProductToDisplay"/>
4651
<actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/>
47-
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="expandSeoSection"/>
48-
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_newDefaultCmsPage.identifier}}" stepKey="fillPageUrlKey"/>
49-
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveCmsPage"/>
52+
<actionGroup ref="AdminExpandSeoSectionActionGroup" stepKey="expandSeoSection"/>
53+
<actionGroup ref="AdminCmsPageSetUrlActionGroup" stepKey="fillPageUrlKey">
54+
<argument name="urlKey" value="{{_newDefaultCmsPage.identifier}}"/>
55+
</actionGroup>
56+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveCmsPage" />
5057
</test>
5158
</tests>

0 commit comments

Comments
 (0)