Skip to content

Commit 1660c11

Browse files
authored
ENGCOM-6888: Marginal space validation #26768
2 parents 0d910ea + fa28a89 commit 1660c11

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
<actionGroup ref="SaveAndCloseCMSBlockWithSplitButtonActionGroup" stepKey="saveAndCloseAction" />
4343
<seeElement selector="div[data-role='grid-wrapper']" stepKey="seeGridPage" />
4444
</test>
45-
</tests>
45+
</tests>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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="AdminCreateCmsBlockWithMarginalSpaceTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="CMS Block Identifier with marginal space"/>
15+
<title value="Admin can not able create a CMS block with marginal space in identifier field"/>
16+
<description value="Admin can not able create a CMS block with marginal space in identifier field"/>
17+
<severity value="CRITICAL"/>
18+
<group value="Cms"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
22+
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
23+
</before>
24+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
25+
<waitForPageLoad stepKey="waitForPageLoad1"/>
26+
<!--Verify Save&Duplicate button and Save&Close button-->
27+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
28+
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
29+
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
30+
<!--Create new CMS Block page with marginal space in identifier field-->
31+
<actionGroup ref="AdminFillCmsBlockFormActionGroup" stepKey="FillOutBlockContent">
32+
<argument name="cmsBlockDataTitle" value="Default Block" />
33+
<argument name="cmsBlockDataIdentifier" value=" block " />
34+
<argument name="cmsBlockDataContent" value="Here is a block test. Yeah!" />
35+
</actionGroup>
36+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
37+
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clicksaveAndClose" />
38+
<waitForPageLoad stepKey="waitForPageLoad3"/>
39+
<see userInput="No marginal white space please" stepKey="seeNoMarginalSpaceMsgOnIdentifierField"/>
40+
</test>
41+
</tests>

app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
<editor>
147147
<validation>
148148
<rule name="required-entry" xsi:type="boolean">true</rule>
149+
<rule name="no-marginal-whitespace" xsi:type="boolean">true</rule>
149150
</validation>
150151
<editorType>text</editorType>
151152
</editor>

0 commit comments

Comments
 (0)