Skip to content

Commit 0ac2e5d

Browse files
mftf coverage
1 parent 74325ef commit 0ac2e5d

File tree

4 files changed

+101
-0
lines changed

4 files changed

+101
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminFillCatalogProductsListWidgetTitleActionGroup">
12+
<annotations>
13+
<description>Fill catalog products list title field.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="title" type="string" defaultValue=""/>
18+
</arguments>
19+
<waitForElementVisible selector="{{InsertWidgetSection.title}}" stepKey="waitForField"/>
20+
<fillField selector="{{InsertWidgetSection.title}}" userInput="{{title}}" stepKey="fillTitleField"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="StorefrontAssertWidgetTitleActionGroup">
12+
<annotations>
13+
<description>Assert widget title on storefront.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="title" type="string"/>
17+
</arguments>
18+
19+
<grabTextFrom selector="{{StorefrontWidgetsSection.widgetProductsGrid}} {{StorefrontWidgetsSection.widgetTitle}}"
20+
stepKey="grabWidgetTitle"/>
21+
<assertEquals stepKey="assertWidgetTitle">
22+
<actualResult type="string">$grabWidgetTitle</actualResult>
23+
<expectedResult type="string">{{title}}</expectedResult>
24+
</assertEquals>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/CatalogWidget/Test/Mftf/Section/CatalogWidgetSection/InsertWidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="checkElementStorefrontByPrice" type="button" selector="//*[@class='product-items widget-product-grid']//*[contains(text(),'${{arg4}}.00')]" parameterized="true"/>
2020
<element name="checkElementStorefrontByName" type="button" selector="//*[@class='product-items widget-product-grid']//*[@class='product-item'][{{productPosition}}]//a[contains(text(), '{{productName}}')]" parameterized="true"/>
2121
<element name="categoryTreeWrapper" type="text" selector=".rule-chooser .tree.x-tree"/>
22+
<element name="title" type="text" selector="input[name='parameters[title]']"/>
2223
</section>
2324
</sections>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StoreFrontWidgetTitleWithReservedCharsTest">
11+
<annotations>
12+
<features value="Cms"/>
13+
<stories value="Create a CMS Page via the Admin when widget title contains reserved chairs"/>
14+
<title value="Create CMS Page via the Admin when widget title contains reserved chairs"/>
15+
<description value="See CMS Page title on store front page if titled widget with reserved chairs added"/>
16+
<severity value="MAJOR"/>
17+
<group value="Cms"/>
18+
<group value="WYSIWYGDisabled"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<createData entity="simpleProductWithoutCategory" stepKey="createSimpleProductWithoutCategory"/>
23+
<createData entity="_defaultCmsPage" stepKey="createCmsPage"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="createSimpleProductWithoutCategory" stepKey="deleteProduct"/>
27+
<deleteData createDataKey="createCmsPage" stepKey="deleteCmsPage" />
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
29+
</after>
30+
<!--Navigate to Page in Admin-->
31+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage">
32+
<argument name="CMSPage" value="$createCmsPage$"/>
33+
</actionGroup>
34+
<!--Insert widget-->
35+
<actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertWidgetToCmsPageContent">
36+
<argument name="widgetType" value="Catalog Products List"/>
37+
</actionGroup>
38+
<!--Fill widget title and save-->
39+
<actionGroup ref="AdminFillCatalogProductsListWidgetTitleActionGroup" stepKey="fillWidgetTitle">
40+
<argument name="title" value="Tittle }}"/>
41+
</actionGroup>
42+
<actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetButton"/>
43+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="saveOpenedPage"/>
44+
<!--Verify data on frontend-->
45+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStorefront">
46+
<argument name="identifier" value="$createCmsPage.identifier$"/>
47+
</actionGroup>
48+
<actionGroup ref="StorefrontAssertWidgetTitleActionGroup" stepKey="verifyPageDataOnFrontend">
49+
<argument name="title" value="Tittle }}"/>
50+
</actionGroup>
51+
</test>
52+
</tests>

0 commit comments

Comments
 (0)