Skip to content

Commit 124c2f9

Browse files
author
Cari Spruiell
committed
MC-1176: Create MFTF tests for configuring grid size
- update tests from CR feedback
1 parent ff3f043 commit 124c2f9

File tree

5 files changed

+117
-36
lines changed

5 files changed

+117
-36
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
@@ -76,6 +76,6 @@
7676
<fillField selector="{{PageBuilderColumnSection.gridSizeInput(index)}}" userInput="{{gridSize}}" stepKey="enterGridSize"/>
7777
<click selector="{{PageBuilderColumnSection.columnX(index)}}" stepKey="clickColumn" />
7878
<waitForPageLoad stepKey="waitForAnimation" />
79-
<waitForElementVisible selector="{{PageBuilderColumnSection.gridSizeError('1', errorMessage)}}" stepKey="verifyError"/>
79+
<waitForElementVisible selector="{{PageBuilderColumnSection.gridSizeError(index, errorMessage)}}" stepKey="verifyError"/>
8080
</actionGroup>
8181
</actionGroups>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@
191191
<data key="maximumGridSizeErrorMessage">The maximum grid size supported is</data>
192192
<data key="smallerThanTotalColumnsErrorMessage">Grid size cannot be smaller than the current total amount of columns, minus any empty columns.</data>
193193
</entity>
194+
<entity name="PageBuilderDefaultColumnGridSize" type="pagebuilder_default_grid_size">
195+
<data key="section">cms_pagebuilder</data>
196+
<data key="row">row_cms_pagebuilder_column_grid_default</data>
197+
<data key="label">Default Column Grid Size</data>
198+
</entity>
199+
<entity name="PageBuilderMaximumColumnGridSize" type="pagebuilder_max_grid_size">
200+
<data key="section">cms_pagebuilder</data>
201+
<data key="row">row_cms_pagebuilder_column_grid_max</data>
202+
<data key="label">Maximum Column Grid Size</data>
203+
</entity>
194204
<entity name="PageBuilderColumnDuplicate" type="pagebuilder_column">
195205
<data key="cannotDuplicateColumnErrorMessage">There is no free space within the column group to perform this action</data>
196206
</entity>

app/code/Magento/PageBuilder/Test/Mftf/Section/ContentManagementSection.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
<element name="GoogleMapsStyleHelperText" type="text" selector="#row_cms_pagebuilder_google_maps_style .value .note span"/>
2727
<element name="GoogleMapsCreateMapStyleLink" type="button" selector="#row_cms_pagebuilder_google_maps_style a[href]"/>
2828
<element name="ColumnGridDefaultInputField" type="input" selector="#cms_pagebuilder_column_grid_default"/>
29-
<element name="ColumnGridMaxInputField" type="input" selector="#cms_pagebuilder_column_grid_max"/>
3029
<element name="ColumnGridDefaultInputFieldError" type="input" selector="//label[@class='mage-error'][@for='cms_pagebuilder_column_grid_default']"/>
30+
<element name="ColumnGridDefaultHelperText" type="text" selector="#row_cms_pagebuilder_column_grid_default .value .note span"/>
31+
<element name="ColumnGridMaxInputField" type="input" selector="#cms_pagebuilder_column_grid_max"/>
3132
<element name="ColumnGridMaxInputFieldError" type="input" selector="//label[@class='mage-error'][@for='cms_pagebuilder_column_grid_max']"/>
33+
<element name="ColumnGridMaxHelperText" type="text" selector="#row_cms_pagebuilder_column_grid_max .value .note span"/>
3234
<element name="UseSystem" type="input" selector="[name='groups[pagebuilder][fields][{{arg1}}][inherit]']" parameterized="true"/>
3335
<element name="UseSystemChecked" type="input" selector="[name='groups[pagebuilder][fields][{{arg1}}][inherit]']:checked" parameterized="true"/>
3436
</section>

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

Lines changed: 102 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<test name="ValidateGridSettingsValidationInSystemConfig">
1212
<annotations>
1313
<features value="Pagebuilder"/>
14-
<stories value="Column"/>
15-
<title value="Verify you cannot set the grid default size higher than the max size."/>
16-
<description value="Verify you cannot set the grid default size higher than the max size."/>
14+
<stories value="Store Configuration - Column Grid Size"/>
15+
<title value="Verify validations for grid default and max size."/>
16+
<description value="Verify validations for grid default and max size."/>
1717
<severity value="CRITICAL"/>
1818
<useCaseId value="MC-950"/>
1919
<testCaseId value="MC-2293"/>
@@ -23,12 +23,14 @@
2323
</annotations>
2424
<before>
2525
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
26+
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
27+
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
2628
</before>
2729
<after>
30+
<magentoCLI command="config:set cms/pagebuilder/column_grid_default 12" stepKey="setDefaultGridSize"/>
31+
<magentoCLI command="config:set cms/pagebuilder/column_grid_max 16" stepKey="setMaxGridSize"/>
2832
<actionGroup ref="logout" stepKey="logout"/>
2933
</after>
30-
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
31-
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
3234
<conditionalClick stepKey="uncheckUseSystemValueDefault" selector="{{ContentManagementSection.UseSystem('column_grid_default')}}" dependentSelector="{{ContentManagementSection.UseSystemChecked('column_grid_default')}}" visible="true"/>
3335
<conditionalClick stepKey="uncheckUseSystemValueMax" selector="{{ContentManagementSection.UseSystem('column_grid_max')}}" dependentSelector="{{ContentManagementSection.UseSystemChecked('column_grid_max')}}" visible="true"/>
3436
<!-- Enter Invalid Default Grid Size -->
@@ -156,7 +158,7 @@
156158
<test name="ValidateOddDefaultGridSizeIsSplitCorrectly">
157159
<annotations>
158160
<features value="Pagebuilder"/>
159-
<stories value="Column"/>
161+
<stories value="Store Configuration - Column Grid Size"/>
160162
<title value="Verify that the initial two column split is correct when the default grid size is odd."/>
161163
<description value="Verify that the initial two column split is correct when the default grid size is odd."/>
162164
<severity value="CRITICAL"/>
@@ -168,62 +170,129 @@
168170
</annotations>
169171
<before>
170172
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
173+
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
174+
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
175+
<conditionalClick stepKey="uncheckUseSystemValueDefault" selector="{{ContentManagementSection.UseSystem('column_grid_default')}}" dependentSelector="{{ContentManagementSection.UseSystemChecked('column_grid_default')}}" visible="true"/>
176+
<!-- Enter Odd Default Grid Size -->
177+
<comment userInput="Enter Odd Default Grid Size" stepKey="comment1"/>
178+
<actionGroup ref="updateDefaultGridSizeConfig" stepKey="enterValidDefaultGridSize">
179+
<argument name="gridSize" value="{{PageBuilderGridSize.gridSize_5}}"/>
180+
</actionGroup>
181+
<actionGroup ref="saveStoreConfiguration" stepKey="saveStoreConfiguration"/>
182+
<see selector="{{ContentManagementSection.StoreConfigurationPageSuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage1"/>
183+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
184+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
171185
</before>
172186
<after>
187+
<magentoCLI command="config:set cms/pagebuilder/column_grid_default 12" stepKey="setDefaultGridSize"/>
188+
<magentoCLI command="config:set cms/pagebuilder/column_grid_max 16" stepKey="setMaxGridSize"/>
173189
<actionGroup ref="logout" stepKey="logout"/>
174190
</after>
175-
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
176-
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
177-
<conditionalClick stepKey="uncheckUseSystemValueDefault" selector="{{ContentManagementSection.UseSystem('column_grid_default')}}" dependentSelector="{{ContentManagementSection.UseSystemChecked('column_grid_default')}}" visible="true"/>
178-
<!-- Enter Odd Default Grid Size -->
179-
<comment userInput="Enter Odd Default Grid Size" stepKey="comment1"/>
180-
<actionGroup ref="updateDefaultGridSizeConfig" stepKey="enterValidDefaultGridSize">
181-
<argument name="gridSize" value="{{PageBuilderGridSize.gridSize_5}}"/>
182-
</actionGroup>
183-
<actionGroup ref="saveStoreConfiguration" stepKey="saveStoreConfiguration"/>
184-
<see selector="{{ContentManagementSection.StoreConfigurationPageSuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage1"/>
185-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
186-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
187191
<actionGroup ref="dragContentTypeToStage" stepKey="dragColumnIntoStage">
188192
<argument name="contentType" value="PageBuilderColumnContentType"/>
189193
</actionGroup>
190-
<seeElement selector="{{PageBuilderColumnSection.displayLabel('1', '3/5')}}" stepKey="verifyFirstColumn"/>
191-
<seeElement selector="{{PageBuilderColumnSection.displayLabel('2', '2/5')}}" stepKey="verifySecondColumn"/>
194+
<waitForElementVisible selector="{{PageBuilderColumnSection.displayLabel('1', '3/5')}}" stepKey="verifyFirstColumn"/>
195+
<waitForElementVisible selector="{{PageBuilderColumnSection.displayLabel('2', '2/5')}}" stepKey="verifySecondColumn"/>
192196
</test>
193197
<test name="ValidateTooltipMessage">
194198
<annotations>
195199
<features value="Pagebuilder"/>
196-
<stories value="Column"/>
200+
<stories value="Store Configuration - Column Grid Size"/>
197201
<title value="Column grid panel tooltip updates with max column size."/>
198202
<description value="Verify that the tooltip for grid size updates to reflect the max column size."/>
199203
<severity value="CRITICAL"/>
204+
<useCaseId value="MC-950"/>
200205
<testCaseId value="MC-2313"/>
201206
<group value="pagebuilder"/>
202207
<group value="pagebuilder-column"/>
203208
<group value="pagebuilder-columnGridSizeConfig"/>
204209
</annotations>
205210
<before>
206211
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
212+
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
213+
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
214+
<conditionalClick stepKey="uncheckUseSystemValue" selector="{{ContentManagementSection.UseSystem('column_grid_max')}}" dependentSelector="{{ContentManagementSection.UseSystemChecked('column_grid_max')}}" visible="true"/>
215+
<comment userInput="Change Maximum Grid Size to 5" stepKey="comment1"/>
216+
<actionGroup ref="updateMaxGridSizeConfig" stepKey="enterValidMaxGridSize">
217+
<argument name="gridSize" value="{{PageBuilderGridSize.gridSize_5}}"/>
218+
</actionGroup>
219+
<actionGroup ref="saveStoreConfiguration" stepKey="saveStoreConfiguration"/>
220+
<see selector="{{ContentManagementSection.StoreConfigurationPageSuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage1"/>
221+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
222+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
207223
</before>
208224
<after>
225+
<magentoCLI command="config:set cms/pagebuilder/column_grid_default 12" stepKey="setDefaultGridSize"/>
226+
<magentoCLI command="config:set cms/pagebuilder/column_grid_max 16" stepKey="setMaxGridSize"/>
209227
<actionGroup ref="logout" stepKey="logout"/>
210228
</after>
211-
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
212-
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
213-
<conditionalClick stepKey="uncheckUseSystemValue" selector="{{ContentManagementSection.UseSystem('column_grid_max')}}" dependentSelector="{{ContentManagementSection.UseSystemChecked('column_grid_max')}}" visible="true"/>
214-
<comment userInput="Change Maximum Grid Size to 5" stepKey="comment1"/>
215-
<actionGroup ref="updateMaxGridSizeConfig" stepKey="enterValidMaxGridSize">
216-
<argument name="gridSize" value="{{PageBuilderGridSize.gridSize_5}}"/>
217-
</actionGroup>
218-
<actionGroup ref="saveStoreConfiguration" stepKey="saveStoreConfiguration"/>
219-
<see selector="{{ContentManagementSection.StoreConfigurationPageSuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage1"/>
220-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
221-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
222229
<actionGroup ref="dragContentTypeToStage" stepKey="dragColumnIntoStage">
223230
<argument name="contentType" value="PageBuilderColumnContentType"/>
224231
</actionGroup>
225232
<actionGroup ref="openGridSizeForm" stepKey="openGridSizeForm" />
226233
<click selector="{{PageBuilderColumnSection.gridSizeTooltip('1')}}" stepKey="clickWithinPanel"/>
227-
<seeElement selector="{{PageBuilderColumnSection.gridSizeTooltipWithMax('1', PageBuilderGridSize.gridSize_5)}}" stepKey="verifyTooltip"/>
234+
<waitForElementVisible selector="{{PageBuilderColumnSection.gridSizeTooltipWithMax('1', PageBuilderGridSize.gridSize_5)}}" stepKey="verifyTooltip"/>
235+
</test>
236+
<test name="DefaultColumnGridSizeFieldAppearance">
237+
<annotations>
238+
<features value="Pagebuilder"/>
239+
<stories value="Store Configuration - Column Grid Size"/>
240+
<title value="Validate Default Column Grid Size Field Appearance"/>
241+
<description value="Verify the Default Column Grid Size field is global and has correct helper text."/>
242+
<severity value="MINOR"/>
243+
<useCaseId value="MC-950"/>
244+
<testCaseId value="MC-2351"/>
245+
<group value="pagebuilder"/>
246+
<group value="pagebuilder-column"/>
247+
<group value="pagebuilder-columnGridSizeConfig"/>
248+
</annotations>
249+
<before>
250+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
251+
<!-- Go To AdminContentManagementPage -->
252+
<comment userInput="Go To AdminContentManagementPage" stepKey="commentGoToPage"/>
253+
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
254+
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
255+
</before>
256+
<after>
257+
<actionGroup ref="logout" stepKey="logout"/>
258+
</after>
259+
<!-- Validate Global Scope -->
260+
<comment userInput="Validate Global Scope" stepKey="commentValidateGlobal"/>
261+
<waitForElementVisible selector="{{ContentManagementSection.ConfigurationFieldLabel(PageBuilderDefaultColumnGridSize.section, PageBuilderDefaultColumnGridSize.row, PageBuilderDefaultColumnGridSize.label)}}[@data-config-scope='[GLOBAL]']" stepKey="waitForConfigurationKeyScope"/>
262+
<!-- Validate Helper Text -->
263+
<comment userInput="Validate Helper Text" stepKey="commentValidateHelperText"/>
264+
<waitForElementVisible selector="{{ContentManagementSection.ColumnGridDefaultHelperText}}" stepKey="waitForHelperText"/>
265+
<see selector="{{ContentManagementSection.ColumnGridDefaultHelperText}}" userInput="Grid size determines the default number of columns available." stepKey="seeHelperText"/>
266+
</test>
267+
<test name="MaximumColumnGridSizeFieldAppearance">
268+
<annotations>
269+
<features value="Pagebuilder"/>
270+
<stories value="Store Configuration - Column Grid Size"/>
271+
<title value="Validate Max Column Grid Size Field Appearance"/>
272+
<description value="Verify the Maximum Column Grid Size field is global and has correct helper text."/>
273+
<severity value="MINOR"/>
274+
<useCaseId value="MC-950"/>
275+
<testCaseId value="MC-2352"/>
276+
<group value="pagebuilder"/>
277+
<group value="pagebuilder-column"/>
278+
<group value="pagebuilder-columnGridSizeConfig"/>
279+
</annotations>
280+
<before>
281+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
282+
<!-- Go To AdminContentManagementPage -->
283+
<comment userInput="Go To AdminContentManagementPage" stepKey="commentGoToPage"/>
284+
<actionGroup ref="navigateToAdminContentManagementPage" stepKey="navigateToAdminContentManagementPage"/>
285+
<conditionalClick stepKey="expandAdvancedContentTools" selector="{{ContentManagementSection.PageBuilderOptions}}" dependentSelector="{{ContentManagementSection.CheckIfPageBuilderTabExpanded}}" visible="true"/>
286+
</before>
287+
<after>
288+
<actionGroup ref="logout" stepKey="logout"/>
289+
</after>
290+
<!-- Validate Global Scope -->
291+
<comment userInput="Validate Global Scope" stepKey="commentValidateGlobal"/>
292+
<waitForElementVisible selector="{{ContentManagementSection.ConfigurationFieldLabel(PageBuilderMaximumColumnGridSize.section, PageBuilderMaximumColumnGridSize.row, PageBuilderMaximumColumnGridSize.label)}}[@data-config-scope='[GLOBAL]']" stepKey="waitForConfigurationKeyScope"/>
293+
<!-- Validate Helper Text -->
294+
<comment userInput="Validate Helper Text" stepKey="commentValidateHelperText"/>
295+
<waitForElementVisible selector="{{ContentManagementSection.ColumnGridMaxHelperText}}" stepKey="waitForHelperText"/>
296+
<see selector="{{ContentManagementSection.ColumnGridMaxHelperText}}" userInput="Maximum grid size determines the maximum amount of columns available." stepKey="seeHelperText"/>
228297
</test>
229298
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<description value="Admin are able to add External URL link into PageBuilder content"/>
1616
<severity value="CRITICAL"/>
1717
<testCaseId value="MAGETWO-89379"/>
18-
<group value="run"/>
18+
<group value="pagebuilder"/>
1919
<group value="pagebuilder-urlInput"/>
2020
</annotations>
2121
<before>

0 commit comments

Comments
 (0)