Skip to content

Commit 77127a0

Browse files
committed
MC-2365: Create MFTF tests for vertical alignment of rows
- add test to check defaults with each new vertical alignment option
1 parent cc1f96d commit 77127a0

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<element name="baseCss" type="text" selector="div.pagebuilder-content-type.pagebuilder-row"/>
2828
<element name="empty" type="button" selector="(//div[contains(@class,'empty-container')]//div[contains(@class,'element-children') and contains(@class,'row-container')])[{{arg1}}]" parameterized="true"/>
2929
<element name="displayLabel" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}]//div[contains(@class,'pagebuilder-display-label')]" parameterized="true"/>
30+
<element name="rowChildrenStyle" type="text" selector="(//div[contains(@class, 'pagebuilder-row')])[{{arg1}}]//div[contains(@class, 'element-children') and contains(@class, 'row-container')][contains(@style, '{{arg2}}')]" parameterized="true"/>
3031
<!-- Background Configuration -->
3132
<element name="backgroundColor" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@style,'background-color: {{arg2}};')]" parameterized="true"/>
3233
<element name="noBackgroundColor" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][not(contains(@style,'background-color:'))]" parameterized="true"/>
@@ -57,6 +58,7 @@
5758
<section name="RowOnStorefront">
5859
<element name="base" type="text" selector="(//div[@data-role='row'])[{{arg1}}]" parameterized="true"/>
5960
<element name="computedWidth" type="text" selector="parseInt(window.getComputedStyle(document.querySelector('[data-role=row]')).width)"/>
61+
<element name="rowStyle" type="button" selector="(//div[@data-role='row'])[{{arg1}}][contains(@style, '{{arg2}}')]" parameterized="true"/>
6062
<!-- Background Configuration -->
6163
<element name="backgroundColor" type="button" selector="(//div[@data-role='row'])[{{arg1}}][contains(@style,'background-color: {{arg2}};')]" parameterized="true"/>
6264
<element name="noBackgroundColor" type="button" selector="(//div[@data-role='row'])[{{arg1}}][not(contains(@style,'background-color:'))]" parameterized="true"/>

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

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,111 @@
342342
<actualResult type="variable">actualStageRowHeightWithSlider</actualResult>
343343
</assertGreaterThanOrEqual>
344344
</test>
345+
<test name="RowContentIsVerticallyAligned">
346+
<annotations>
347+
<features value="Pagebuilder"/>
348+
<stories value="Row"/>
349+
<title value="Row Content Can Be Vertically Aligned"/>
350+
<description value="A user can vertically align row contents"/>
351+
<severity value="CRITICAL"/>
352+
<useCaseId value="MC-914"/>
353+
<testCaseId value="MC-2388"/>
354+
<group value="pagebuilder"/>
355+
<group value="pagebuilder-row"/>
356+
</annotations>
357+
<before>
358+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
359+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
360+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
361+
</before>
362+
<after>
363+
<actionGroup ref="logout" stepKey="logout"/>
364+
</after>
365+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle1">
366+
<argument name="contentType" value="PageBuilderRowContentType"/>
367+
</actionGroup>
368+
<!-- Add two rows to stage -->
369+
<comment userInput="Add two rows to the stage" stepKey="commentAddTwoRows"/>
370+
<actionGroup ref="dragContentTypeToStage" stepKey="dragSecondRowIntoStage">
371+
<argument name="contentType" value="PageBuilderRowContentType"/>
372+
</actionGroup>
373+
<actionGroup ref="dragContentTypeToStage" stepKey="dragThirdRowIntoStage">
374+
<argument name="contentType" value="PageBuilderRowContentType"/>
375+
</actionGroup>
376+
<!-- Configure First Row - Vertical Align Top -->
377+
<comment userInput="Configure vertical align top" stepKey="commentConfigureVerticalAlignTop"/>
378+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForFirstRow">
379+
<argument name="contentType" value="PageBuilderRowContentType"/>
380+
<argument name="contentTypeIndex" value="1"/>
381+
</actionGroup>
382+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmentTopProperty">
383+
<argument name="property" value="PageBuilderVerticalAlignmentPropertyTop"/>
384+
</actionGroup>
385+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsFirstRow"/>
386+
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToFirstRow">
387+
<argument name="contentType" value="PageBuilderHeadingContentType"/>
388+
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
389+
<argument name="containerTargetIndex" value="1"/>
390+
<argument name="contentTypeIndex" value="1"/>
391+
</actionGroup>
392+
<actionGroup ref="clickOutsideLiveEditHeading" stepKey="clickOutsideLiveEditHeading1">
393+
<argument name="index" value="1"/>
394+
</actionGroup>
395+
<!-- Configure Second Row - Vertical Align Center -->
396+
<comment userInput="Configure vertical align center" stepKey="commentConfigureVerticalAlignCenter"/>
397+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForSecondRow">
398+
<argument name="contentType" value="PageBuilderRowContentType"/>
399+
<argument name="contentTypeIndex" value="2"/>
400+
</actionGroup>
401+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmenCenterProperty">
402+
<argument name="property" value="PageBuilderVerticalAlignmentPropertyCenter"/>
403+
</actionGroup>
404+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsSecondRow"/>
405+
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToSecondRow">
406+
<argument name="contentType" value="PageBuilderHeadingContentType"/>
407+
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
408+
<argument name="containerTargetIndex" value="2"/>
409+
<argument name="contentTypeIndex" value="1"/>
410+
</actionGroup>
411+
<actionGroup ref="clickOutsideLiveEditHeading" stepKey="clickOutsideLiveEditHeading2">
412+
<argument name="index" value="2"/>
413+
</actionGroup>
414+
<!-- Configure Third Row - Vertical Align Bottom -->
415+
<comment userInput="Configure vertical align bottom" stepKey="commentConfigureVerticalAlignBottom"/>
416+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForThirdRow">
417+
<argument name="contentType" value="PageBuilderRowContentType"/>
418+
<argument name="contentTypeIndex" value="3"/>
419+
</actionGroup>
420+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmentBottomProperty">
421+
<argument name="property" value="PageBuilderVerticalAlignmentPropertyBottom"/>
422+
</actionGroup>
423+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsThirdColumn"/>
424+
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToThirdRow">
425+
<argument name="contentType" value="PageBuilderHeadingContentType"/>
426+
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
427+
<argument name="containerTargetIndex" value="3"/>
428+
<argument name="contentTypeIndex" value="1"/>
429+
</actionGroup>
430+
<!-- Verify Vertical Alignment On Stage - Before Save -->
431+
<comment userInput="Verify vertical alignment on stage before save" stepKey="commentVerifyVerticalAlignmentOnStageBeforeSave"/>
432+
<seeElement selector="{{RowOnStage.rowChildrenStyle('1', PageBuilderCommonStyles.verticalAlignmentTop)}}" stepKey="seeFirstRowVerticalAlignmentTop"/>
433+
<seeElement selector="{{RowOnStage.rowChildrenStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeSecondRowVerticalAlignmentCenter"/>
434+
<seeElement selector="{{RowOnStage.rowChildrenStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeThirdRowVerticalAlignmentBottom"/>
435+
<!-- Verify Vertical Alignment On Stage - After Save -->
436+
<comment userInput="Verify vertical alignment on stage after save" stepKey="commentVerifyVerticalAlignmentOnStageAfterSave"/>
437+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
438+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
439+
<seeElement selector="{{RowOnStage.rowChildrenStyle('1', PageBuilderCommonStyles.verticalAlignmentTop)}}" stepKey="seeFirstRowVerticalAlignmentTopAfterSave"/>
440+
<seeElement selector="{{RowOnStage.rowChildrenStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeSecondRowVerticalAlignmentCenterAfterSave"/>
441+
<seeElement selector="{{RowOnStage.rowChildrenStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeThirdRowVerticalAlignmentBottomAfterSave"/>
442+
<!-- Verify Vertical Alignment In Storefront -->
443+
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
444+
<argument name="contentType" value="PageBuilderRowContentType"/>
445+
</actionGroup>
446+
<seeElement selector="{{RowOnStorefront.rowStyle('1', PageBuilderCommonStyles.verticalAlignmentTop)}}" stepKey="seeRow1VerticalAlignmentTopApplied"/>
447+
<seeElement selector="{{RowOnStorefront.rowStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeRow2VerticalAlignmentCenterApplied"/>
448+
<seeElement selector="{{RowOnStorefront.rowStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeRow3VerticalAlignmentBottomApplied"/>
449+
</test>
345450
<test name="RowValidateAdvancedConfigurationDefaultValues">
346451
<annotations>
347452
<features value="Pagebuilder: Row"/>

0 commit comments

Comments
 (0)