Skip to content

Commit ddf45e8

Browse files
committed
MC-2340: Can Input 0 Into Grid Size & Dont Get Error
- Update tests to use entity data
1 parent eebe259 commit ddf45e8

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ColumnActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<arguments>
7272
<argument name="index" defaultValue="1" type="string"/>
7373
<argument name="gridSize" defaultValue="12" type="string"/>
74-
<argument name="errorMessage" type="string"/>
74+
<argument name="errorMessage"/>
7575
</arguments>
7676
<fillField selector="{{PageBuilderColumnSection.gridSizeInput(index)}}" userInput="{{gridSize}}" stepKey="enterGridSize"/>
7777
<click selector="{{PageBuilderColumnSection.columnX(index)}}" stepKey="clickColumn" />

app/code/Magento/PageBuilder/Test/Mftf/Data/ColumnData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
<data key="invalidDefaultGridSizeErrorMessage">Default grid size must be less than the maximum grid size.</data>
187187
<data key="invalidDigitErrorMessage">Please enter a valid number in this field.</data>
188188
<data key="greaterThanOneErrorMessage">Please enter a number 2 or greater in this field.</data>
189+
<data key="minimumGridSizeErrorMessage">The minimum grid size supported is 2.</data>
190+
<data key="maximumGridSizeErrorMessage">The maximum grid size supported is</data>
191+
<data key="smallerThanTotalColumnsErrorMessage">Grid size cannot be smaller than the current total amount of columns, minus any empty columns.</data>
189192
</entity>
190193
<entity name="PageBuilderColumnDuplicate" type="pagebuilder_column">
191194
<data key="cannotDuplicateColumnErrorMessage">There is no free space within the column group to perform this action</data>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderColumnGridTest.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@
580580
<actionGroup ref="updateGridSizeInvalid" stepKey="enterGridSizeOverMax">
581581
<argument name="gridSize" value="50"/>
582582
<argument name="index" value="1"/>
583-
<argument name="errorMessage" value="maximum grid size supported"/>
583+
<argument name="errorMessage" value="PageBuilderGridSize.maximumGridSizeErrorMessage"/>
584584
</actionGroup>
585585
</test>
586586
<test name="ValidateInvalidGridSizeError">
@@ -611,17 +611,17 @@
611611
<actionGroup ref="updateGridSizeInvalid" stepKey="enterNegativeGridSize">
612612
<argument name="gridSize" value="-50"/>
613613
<argument name="index" value="1"/>
614-
<argument name="errorMessage" value="minimum grid size supported"/>
614+
<argument name="errorMessage" value="PageBuilderGridSize.minimumGridSizeErrorMessage"/>
615615
</actionGroup>
616616
<actionGroup ref="updateGridSizeInvalid" stepKey="enterGridSize1">
617617
<argument name="gridSize" value="1"/>
618618
<argument name="index" value="1"/>
619-
<argument name="errorMessage" value="minimum grid size supported"/>
619+
<argument name="errorMessage" value="PageBuilderGridSize.minimumGridSizeErrorMessage"/>
620620
</actionGroup>
621621
<actionGroup ref="updateGridSizeInvalid" stepKey="enterGridSize0">
622622
<argument name="gridSize" value="0"/>
623623
<argument name="index" value="1"/>
624-
<argument name="errorMessage" value="minimum grid size supported"/>
624+
<argument name="errorMessage" value="PageBuilderGridSize.minimumGridSizeErrorMessage"/>
625625
</actionGroup>
626626
</test>
627627
<test name="ValidateDifferentGridSizePerGroup">
@@ -699,7 +699,7 @@
699699
<actionGroup ref="updateGridSizeInvalid" stepKey="enterInvalidGridSize">
700700
<argument name="gridSize" value="50"/>
701701
<argument name="index" value="1"/>
702-
<argument name="errorMessage" value="maximum grid size supported"/>
702+
<argument name="errorMessage" value="PageBuilderGridSize.maximumGridSizeErrorMessage"/>
703703
</actionGroup>
704704
<click selector="{{PageBuilderColumnSection.columnGroup}}" stepKey="clickOtherArea"/>
705705
<seeElement selector="{{PageBuilderColumnSection.gridSizeError('1', 'maximum grid size supported')}}" stepKey="verifyMaxError2"/>
@@ -768,7 +768,7 @@
768768
<actionGroup ref="updateGridSizeInvalid" stepKey="enterInvalidGridSize">
769769
<argument name="gridSize" value="3"/>
770770
<argument name="index" value="1"/>
771-
<argument name="errorMessage" value="cannot be smaller"/>
771+
<argument name="errorMessage" value="PageBuilderGridSize.smallerThanTotalColumnsErrorMessage"/>
772772
</actionGroup>
773773
</test>
774774
<test name="MoveColumnBetweenGroupsOfDifferentGridSize">

0 commit comments

Comments
 (0)