Skip to content

Commit b33dced

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'MC-12209' into functional--test--automation
2 parents c8c76a4 + 7f32268 commit b33dced

File tree

19 files changed

+348
-13
lines changed

19 files changed

+348
-13
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="AdminOpenCreateNewWidgetsOfCatalogProductLinkActionGroup">
11+
<annotations>
12+
<description>Open create new Widgets.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="WidgetType" type="string" defaultValue="Catalog Product Link"/>
16+
<argument name="WidgetTheme" type="string" defaultValue="Magento Luma"/>
17+
<argument name="WidgetTitle" type="string" defaultValue="NewWidget"/>
18+
<argument name="AssigntoStoreViews" type="string" defaultValue="All Store Views"/>
19+
<argument name="WidgetDisplayOn" type="string" defaultValue="All Pages"/>
20+
<argument name="Container" type="string" defaultValue="Main Content Area"/>
21+
<argument name="Template" type="string" defaultValue="Product Link Block Template"/>
22+
</arguments>
23+
24+
<amOnPage url="{{CmsNewWidgetsPage.url}}" stepKey="navigateToCreateWidgetsPage"/>
25+
<waitForPageLoad stepKey="wait1"/>
26+
27+
<selectOption selector="{{CmsNewWidgetsSettingSection.WidgetType}}" userInput="{{WidgetType}}" stepKey="selectCMSStaticBlock"/>
28+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear1"/>
29+
<selectOption selector="{{CmsNewWidgetsSettingSection.WidgetTheme}}" userInput="{{WidgetTheme}}" stepKey="selectTemplate"/>
30+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear2"/>
31+
<click selector="{{CmsNewWidgetsSettingSection.ContinueButton}}" stepKey="clickContinueButton"/>
32+
<waitForPageLoad stepKey="wait2"/>
33+
34+
<fillField selector="{{CmsNewWidgetStoreforntPropertiesSection.WidgetTitle}}" userInput="{{WidgetTitle}}" stepKey="fillFieldTitle"/>
35+
<selectOption selector="{{CmsNewWidgetStoreforntPropertiesSection.AssigntoStoreViews}}" userInput="{{AssigntoStoreViews}}" stepKey="selectView"/>
36+
<click selector="{{CmsNewWidgetStoreforntPropertiesSection.AddLayout}}" stepKey="clickAddLayoutButton"/>
37+
<scrollTo selector="{{CmsNewWidgetStoreforntPropertiesSection.AddLayout}}" stepKey="scrollToAddLayoutTab"/>
38+
<waitForPageLoad stepKey="wait3"/>
39+
40+
<selectOption selector="{{CmsNewWidgetUpdateLayoutSection.DisplayOn}}" userInput="{{WidgetDisplayOn}}" stepKey="selectDispaly"/>
41+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear3"/>
42+
<selectOption selector="{{CmsNewWidgetUpdateLayoutSection.Container}}" userInput="{{Container}}" stepKey="selectContainer"/>
43+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear4"/>
44+
<selectOption selector="{{CmsNewWidgetUpdateLayoutSection.Template}}" userInput="{{Template}}" stepKey="selectTemplate2"/>
45+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear5"/>
46+
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
47+
<waitForPageLoad stepKey="wait4"/>
48+
49+
<click selector="{{CmsNewWidgetOptionsSection.WidgetOptions}}" stepKey="clickButton22"/>
50+
<click selector="{{CmsNewWidgetOptionsSection.SelectProduct}}" stepKey="clickSelectProductButton"/>
51+
<waitForPageLoad stepKey="wait5"/>
52+
<click selector="{{CmsNewWidgetOptionsSection.FirstProduct}}" stepKey="clickFirstProductToSelect"/>
53+
<waitForPageLoad stepKey="wait6"/>
54+
<click selector="{{CmsNewWidgetOptionsSection.SaveWidget}}" stepKey="clickSaveWidgetButton"/>
55+
<waitForPageLoad stepKey="wait7"/>
56+
57+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
58+
</actionGroup>
59+
</actionGroups>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminUpdateWidgetsOfCatalogProductLinkActionGroup">
11+
<annotations>
12+
<description>Update Widgets.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="WidgetTitle" type="string" defaultValue="Catalog B Product Link"/>
16+
</arguments>
17+
18+
<click selector="{{CmsNewWidgetOptionsSection.FirstWidget}}" stepKey="clickFirstWidgetSelect"/>
19+
<waitForPageLoad stepKey="wait2"/>
20+
21+
<clearField selector="{{CmsNewWidgetStoreforntPropertiesSection.WidgetTitle}}" stepKey="clearWidgetTitle"/>
22+
<fillField selector="{{CmsNewWidgetStoreforntPropertiesSection.WidgetTitle}}" userInput="{{WidgetTitle}}" stepKey="fillFieldTitle"/>
23+
24+
<click selector="{{CmsNewWidgetOptionsSection.WidgetOptions}}" stepKey="clickButton23"/>
25+
<waitForPageLoad stepKey="wait3"/>
26+
<click selector="{{CmsNewWidgetOptionsSection.SelectProduct}}" stepKey="clickSelectProductButton1"/>
27+
<waitForPageLoad stepKey="wait4"/>
28+
<click selector="{{CmsNewWidgetOptionsSection.SecondProduct}}" stepKey="clickSecondProductToSelect"/>
29+
<waitForPageLoad stepKey="wait5"/>
30+
<click selector="{{CmsNewWidgetOptionsSection.SaveWidget}}" stepKey="clickSaveWidgetButton2"/>
31+
<waitForPageLoad stepKey="wait6"/>
32+
33+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
34+
35+
</actionGroup>
36+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Data/AdminMenuData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
<data key="title">Pages</data>
1919
<data key="dataUiId">magento-cms-cms-page</data>
2020
</entity>
21+
22+
<entity name="AdminMenuContentElementsWidgets">
23+
<data key="pageTitle">Widgets</data>
24+
<data key="title">Widgets</data>
25+
<data key="dataUiId">magento-widget-cms-widget-instance</data>
26+
</entity>
27+
2128
<entity name="AdminMenuContentElementsBlocks">
2229
<data key="pageTitle">Blocks</data>
2330
<data key="title">Blocks</data>
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+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="CmsNewWidgetsPage" url="/admin/widget_instance/new/" area="admin" module="Magento_Cms">
12+
<section name="CmsNewWidgetsSettingSection"/>
13+
<section name="CmsNewWidgetStoreforntPropertiesSection"/>
14+
<section name="CmsNewWidgetUpdateLayoutSection"/>
15+
<section name="CmsNewWidgetOptionsSection"/>
16+
</page>
17+
</pages>

app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontHeaderSection">
12+
<element name="ProductWidgetLink" type="text" selector="//*[@id='maincontent']/div[3]/div[1]/div[2]/a/span"/>
1213
<element name="headerlinks" type="text" selector="ul.header.links"/>
1314
<element name="headerLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" parameterized="true"/>
1415
</section>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CmsNewWidgetOptionsSection">
12+
<element name="WidgetOptions" type="text" selector="//*[@id='widget_instace_tabs_properties_section']/span[1]"/>
13+
<element name="SelectProduct" type="button" selector="//span[contains(text(),'Select Product...')]"/>
14+
<element name="FirstProduct" type="text" selector="//div[@class='admin__data-grid-wrap admin__data-grid-wrap-static']//tbody/tr[1]"/>
15+
<element name="SecondProduct" type="text" selector="//div[@class='admin__data-grid-wrap admin__data-grid-wrap-static']//tbody/tr[2]"/>
16+
<element name="SaveWidget" type="button" selector="//button[@id='save']"/>
17+
<element name="FirstWidget" type="text" selector="//tbody/tr[1]/td[3]"/>
18+
</section>
19+
</sections>
20+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CmsNewWidgetStoreforntPropertiesSection">
12+
<element name="WidgetTitle" type="text" selector="#title"/>
13+
<element name="AssigntoStoreViews" type="button" selector="#store_ids"/>
14+
<element name="AddLayout" type="button" selector="//span[contains(text(),'Add Layout Update')]"/>
15+
</section>
16+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CmsNewWidgetUpdateLayoutSection">
12+
<element name="DisplayOn" type="button" selector="#widget_instance\[0\]\[page_group\]"/>
13+
<element name="Container" type="button" selector="#all_pages_0 > table > tbody > tr > td:nth-child(1) > div > div > select"/>
14+
<element name="Template" type="button" selector="#all_pages_0 > table > tbody > tr > td:nth-child(2) > div > div > select"/>
15+
</section>
16+
</sections>
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CmsNewWidgetsSettingSection">
12+
<element name="WidgetType" type="button" selector="#code"/>
13+
<element name="WidgetTheme" type="button" selector="#theme_id"/>
14+
<element name="ContinueButton" type="button" selector="//span[contains(text(),'Continue')]"/>
15+
16+
</section>
17+
</sections>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAddUpdateDeleteWidgetOfTypeCatalogProductLinkTypeTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="MC-12209- New Widgets Creation"/>
15+
<title value="Admin should be able to create widget type of Catalog product link"/>
16+
<description value="Admin should be able to create widget type of Catalog product link and shown on storefront"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-12209"/>
19+
</annotations>
20+
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
23+
<createData entity="_defaultProduct" stepKey="createPreReqProduct1">
24+
<requiredEntity createDataKey="createPreReqCategory"/>
25+
</createData>
26+
<createData entity="_defaultProduct" stepKey="createPreReqProduct2">
27+
<requiredEntity createDataKey="createPreReqCategory"/>
28+
</createData>
29+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
30+
</before>
31+
32+
<!--Main test-->
33+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentPagesPage">
34+
<argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/>
35+
<argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/>
36+
</actionGroup>
37+
38+
<actionGroup ref="AdminOpenCreateNewWidgetsOfCatalogProductLinkActionGroup" stepKey="createWidget">
39+
<argument name="WidgetType" value="Catalog Product Link"/>
40+
<argument name="WidgetTheme" value="Magento Luma"/>
41+
<argument name="WidgetTitle" value="NewWidget"/>
42+
<argument name="AssigntoStoreViews" value="All Store Views"/>
43+
<argument name="WidgetDisplayOn" value="All Pages"/>
44+
<argument name="Container" value="Main Content Area"/>
45+
<argument name="Template" value="Product Link Block Template"/>
46+
</actionGroup>
47+
48+
<amOnPage url="{{StorefrontCategoryPage.url($createPreReqCategory.custom_attributes[url_key]$)}}" stepKey="navigateToCategoryPage"/>
49+
<waitForPageLoad stepKey="wait1"/>
50+
<click selector="{{StorefrontHeaderSection.ProductWidgetLink}}" stepKey="clickProductLinkButton"/>
51+
<waitForPageLoad stepKey="wait2"/>
52+
<actionGroup ref="AssertStorefrontProductDetailPageNameActionGroup" stepKey="assertProductNameText">
53+
<argument name="productName" value="$createPreReqProduct1.name$"/>
54+
</actionGroup>
55+
56+
<amOnPage url="admin" stepKey="openAdminPanelPage" />
57+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentPagesPage2">
58+
<argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/>
59+
<argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/>
60+
</actionGroup>
61+
62+
<actionGroup ref="AdminUpdateWidgetsOfCatalogProductLinkActionGroup" stepKey="updateWidget">
63+
<argument name="WidgetTitle" value="Catalog B Product Link"/>
64+
</actionGroup>
65+
66+
<amOnPage url="{{StorefrontCategoryPage.url($createPreReqCategory.custom_attributes[url_key]$)}}" stepKey="navigateToCategoryPage2"/>
67+
<waitForPageLoad stepKey="wait3"/>
68+
<click selector="{{StorefrontHeaderSection.ProductWidgetLink}}" stepKey="clickProductLinkButton2"/>
69+
<waitForPageLoad stepKey="wait4"/>
70+
<actionGroup ref="AssertStorefrontProductDetailPageNameActionGroup" stepKey="assertProductNameText2">
71+
<argument name="productName" value="$createPreReqProduct2.name$"/>
72+
</actionGroup>
73+
74+
<amOnPage url="admin" stepKey="openAdminPanelPage2"/>
75+
<actionGroup ref="AdminMassDeleteWidgetActionGroup" stepKey="massWidgetDelete">
76+
<argument name="row" value="1"/>
77+
</actionGroup>
78+
<waitForPageLoad stepKey="wait5"/>
79+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
80+
81+
<amOnPage url="{{StorefrontCategoryPage.url($createPreReqCategory.custom_attributes[url_key]$)}}" stepKey="navigateToCategoryPage3"/>
82+
<waitForPageLoad stepKey="wait6"/>
83+
<dontSeeElement selector="{{StorefrontHeaderSection.ProductWidgetLink}}" stepKey="doNotWidgetLink"/>
84+
85+
<after>
86+
87+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog"/>
88+
<deleteData createDataKey="createPreReqProduct1" stepKey="deletePreReqProduct"/>
89+
<deleteData createDataKey="createPreReqProduct2" stepKey="deletePreReqProduct2"/>
90+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
91+
</after>
92+
</test>
93+
</tests>

0 commit comments

Comments
 (0)