Skip to content

Commit af28368

Browse files
added mftf coverage
1 parent e846d59 commit af28368

File tree

4 files changed

+123
-0
lines changed

4 files changed

+123
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AdminAssertCMSPageContentParamValueActionGroup">
11+
<annotations>
12+
<description>Assert content param with value on CMS page.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="param" type="string"/>
16+
<argument name="value" type="string"/>
17+
</arguments>
18+
19+
<grabValueFrom selector="{{CmsNewPagePageActionsSection.content}}" stepKey="grabContent"/>
20+
<assertStringContainsString stepKey="assertClass">
21+
<actualResult type="string">{$grabContent}</actualResult>
22+
<expectedResult type="string">{{param}}=&quot;{{value}}&quot;</expectedResult>
23+
</assertStringContainsString>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminClickSelectBlockActionGroup">
11+
<annotations>
12+
<description>Click on Select Block button.</description>
13+
</annotations>
14+
15+
<waitForElementVisible selector="{{WidgetSection.BtnChooser}}" stepKey="waitForSelectBlockButtonVisible"/>
16+
<click selector="{{WidgetSection.BtnChooser}}" stepKey="clickSelectBlockBtn"/>
17+
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 22 additions & 0 deletions
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminSelectBlockOnGridActionGroup">
11+
<annotations>
12+
<description>Selects block on grid and click insert widget button.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="block"/>
16+
</arguments>
17+
18+
<click selector="{{WidgetSection.BlockPage(block.identifier)}}" stepKey="selectPreCreateBlock" />
19+
<waitForElementVisible selector="{{WidgetSection.InsertWidget}}" stepKey="waitForInsertWidgetBtn"/>
20+
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" />
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="AdminAddBlockWidgetToCMSPageTest">
11+
<annotations>
12+
<features value="Cms"/>
13+
<stories value="Add block to page and check block id"/>
14+
<title value="Add block to CMS page and check block id"/>
15+
<description value="Add block to CMS page and check block_id in content"/>
16+
<severity value="AVERAGE"/>
17+
<group value="backend"/>
18+
<group value="Cms"/>
19+
<group value="WYSIWYGDisabled"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
23+
<createData entity="_defaultBlock" stepKey="createPreReqBlock">
24+
<field key="identifier">block-id-777</field>
25+
</createData>
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
27+
</before>
28+
<after>
29+
<deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" />
30+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
32+
</after>
33+
34+
<!-- Navigate to Page in Admin -->
35+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage">
36+
<argument name="CMSPage" value="$$createCMSPage$$"/>
37+
</actionGroup>
38+
39+
<!-- Insert block page -->
40+
<actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertWidgetToCmsPageContent">
41+
<argument name="widgetType" value="CMS Static Block"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminClickSelectBlockActionGroup" stepKey="clickSelectBlockButton"/>
44+
<actionGroup ref="searchBlockOnGridPage" stepKey="searchBlockOnGridPage">
45+
<argument name="Block" value="$$createPreReqBlock$$"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminSelectBlockOnGridActionGroup" stepKey="selectBlockOnGrid">
48+
<argument name="block" value="$$createPreReqBlock$$"/>
49+
</actionGroup>
50+
51+
<!-- Assert block_id value in page content -->
52+
<actionGroup ref="AdminAssertCMSPageContentParamValueActionGroup" stepKey="assertBlockId">
53+
<argument name="param" value="block_id"/>
54+
<argument name="value" value="$$createPreReqBlock.identifier$$"/>
55+
</actionGroup>
56+
</test>
57+
</tests>

0 commit comments

Comments
 (0)