Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marginal space validation #26768

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFillCmsBlockFormActionGroup">
<annotations>
<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>
</annotations>
<arguments>
<argument name="cmsBlockDataTitle" type="string" />
<argument name="cmsBlockDataIdentifier" type="string" />
<argument name="cmsBlockDataContent" type="string" />
</arguments>
<fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{cmsBlockDataTitle}}" stepKey="fillFieldTitle1"/>
<fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{cmsBlockDataIdentifier}}" stepKey="fillFieldIdentifier"/>
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView"/>
<fillField selector="{{BlockContentSection.TextArea}}" userInput="{{cmsBlockDataContent}}" stepKey="fillContentField"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
<actionGroup ref="SaveAndCloseCMSBlockWithSplitButtonActionGroup" stepKey="saveAndCloseAction" />
<seeElement selector="div[data-role='grid-wrapper']" stepKey="seeGridPage" />
</test>
</tests>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCreateCmsBlockWithMarginalSpaceTest">
<annotations>
<features value="Cms"/>
<stories value="CMS Block Identifier with marginal space"/>
<title value="Admin can not able create a CMS block with marginal space in identifier field"/>
<description value="Admin can not able create a CMS block with marginal space in identifier field"/>
<severity value="CRITICAL"/>
<group value="Cms"/>
</annotations>
<before>
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
</before>
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<!--Verify Save&Duplicate button and Save&Close button-->
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
<!--Create new CMS Block page with marginal space in identifier field-->
<actionGroup ref="AdminFillCmsBlockFormActionGroup" stepKey="FillOutBlockContent">
<argument name="cmsBlockDataTitle" value="Default Block" />
<argument name="cmsBlockDataIdentifier" value=" block " />
<argument name="cmsBlockDataContent" value="Here is a block test. Yeah!" />
</actionGroup>
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clicksaveAndClose" />
<waitForPageLoad stepKey="waitForPageLoad3"/>
<see userInput="No marginal white space please" stepKey="seeNoMarginalSpaceMsgOnIdentifierField"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<editor>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
<rule name="no-marginal-whitespace" xsi:type="boolean">true</rule>
</validation>
<editorType>text</editorType>
</editor>
Expand Down