Skip to content

Commit e0015b4

Browse files
Covered validation with MFTF test
1 parent 3e0ffb7 commit e0015b4

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillCmsBlockFormActionGroup">
12+
<annotations>
13+
<description>Fills in the Block Title, Identifier with marginal space, Store View and Content. PLEASE NOTE: The values are passed through arguments in test.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="cmsBlockDataTitle" type="string" />
17+
<argument name="cmsBlockDataIdentifier" type="string" />
18+
<argument name="cmsBlockDataContent" type="string" />
19+
</arguments>
20+
<fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{cmsBlockDataTitle}}" stepKey="fillFieldTitle1"/>
21+
<fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{cmsBlockDataIdentifier}}" stepKey="fillFieldIdentifier"/>
22+
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView"/>
23+
<fillField selector="{{BlockContentSection.TextArea}}" userInput="{{cmsBlockDataContent}}" stepKey="fillContentField"/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,34 @@
4949
<see userInput="You saved the block." stepKey="seeSavedBlockMsgOnGrid"/>
5050
<seeElement selector="div[data-role='grid-wrapper']" stepKey="seeGridPage" />
5151
</test>
52+
<test name="AdminCreateCmsBlockWithMarginalSpaceTest">
53+
<annotations>
54+
<features value="Cms"/>
55+
<stories value="CMS Block Identifier with marginal space"/>
56+
<title value="Admin can not able create a CMS block with marginal space in identifier field"/>
57+
<description value="Admin can not able create a CMS block with marginal space in identifier field"/>
58+
<severity value="CRITICAL"/>
59+
<group value="Cms"/>
60+
</annotations>
61+
<before>
62+
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
63+
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
64+
</before>
65+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
66+
<waitForPageLoad stepKey="waitForPageLoad1"/>
67+
<!--Verify Save&Duplicate button and Save&Close button-->
68+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
69+
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
70+
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
71+
<!--Create new CMS Block page with marginal space in identifier field-->
72+
<actionGroup ref="AdminFillCmsBlockFormActionGroup" stepKey="FillOutBlockContent">
73+
<argument name="cmsBlockDataTitle" value="Default Block" />
74+
<argument name="cmsBlockDataIdentifier" value=" block " />
75+
<argument name="cmsBlockDataContent" value="Here is a block test. Yeah!" />
76+
</actionGroup>
77+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
78+
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clicksaveAndClose" />
79+
<waitForPageLoad stepKey="waitForPageLoad3"/>
80+
<see userInput="No marginal white space please" stepKey="seeNoMarginalSpaceMsgOnIdentifierField"/>
81+
</test>
5282
</tests>

0 commit comments

Comments
 (0)