Skip to content

Commit b71b573

Browse files
committed
MC-2365: Create MFTF tests for vertical alignment of rows
- add selector for row styles - add test to check for different min heights with vertical alignment
1 parent 03aac8b commit b71b573

File tree

3 files changed

+130
-0
lines changed

3 files changed

+130
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
</entity>
5858
<!-- Styles -->
5959
<entity name="PageBuilderCommonStyles" type="pagebuilder_common_styles">
60+
<data key="minHeight500">min-height: 500px</data>
61+
<data key="minHeight300">min-height: 300px</data>
62+
<data key="minHeight200">min-height: 200px</data>
6063
<data key="verticalAlignmentBottom">justify-content: flex-end</data>
6164
<data key="verticalAlignmentCenter">justify-content: center</data>
6265
<data key="verticalAlignmentTop">justify-content: flex-start</data>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
<element name="parallaxState" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][@data-enable-parallax='{{arg2}}']" parameterized="true"/>
4343
<element name="parallaxSpeed" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][@data-parallax-speed='{{arg2}}']" parameterized="true"/>
4444
<element name="parallaxBackgroundImage" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@data-jarallax-original-styles,'background-image: url(') and contains(@data-jarallax-original-styles,'{{arg2}}') and contains(@data-jarallax-original-styles,'{{arg3}}&quot;);')]" parameterized="true"/>
45+
<!-- Layout Configuration -->
46+
<element name="minHeight" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@style,'min-height: {{arg2}}px;')]" parameterized="true"/>
4547
<!-- Advanced Configuration -->
4648
<element name="alignment" type="text" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@style,'text-align: {{arg2}};')]" parameterized="true"/>
4749
<element name="noAlignment" type="text" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][not(contains(@style,'text-align:'))]" parameterized="true"/>

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

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,131 @@
447447
<seeElement selector="{{RowOnStorefront.rowStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeRow2VerticalAlignmentCenterApplied"/>
448448
<seeElement selector="{{RowOnStorefront.rowStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeRow3VerticalAlignmentBottomApplied"/>
449449
</test>
450+
<test name="RowContentIsVerticallyAlignedWithDifferentMinimumHeights">
451+
<annotations>
452+
<features value="Pagebuilder"/>
453+
<stories value="Row"/>
454+
<title value="Row Content Can Be Vertically Aligned With Different Heights"/>
455+
<description value="A user can vertically align row contents with different heights"/>
456+
<severity value="CRITICAL"/>
457+
<useCaseId value="MC-914"/>
458+
<testCaseId value="MC-2389"/>
459+
<group value="pagebuilder"/>
460+
<group value="pagebuilder-row"/>
461+
</annotations>
462+
<before>
463+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
464+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
465+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
466+
</before>
467+
<after>
468+
<actionGroup ref="logout" stepKey="logout"/>
469+
</after>
470+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle1">
471+
<argument name="contentType" value="PageBuilderRowContentType"/>
472+
</actionGroup>
473+
<!-- Add two rows to stage -->
474+
<comment userInput="Add two rows to the stage" stepKey="commentAddTwoRows"/>
475+
<actionGroup ref="dragContentTypeToStage" stepKey="dragSecondRowIntoStage">
476+
<argument name="contentType" value="PageBuilderRowContentType"/>
477+
</actionGroup>
478+
<actionGroup ref="dragContentTypeToStage" stepKey="dragThirdRowIntoStage">
479+
<argument name="contentType" value="PageBuilderRowContentType"/>
480+
</actionGroup>
481+
<!-- Configure First Row - Vertical Align Top -->
482+
<comment userInput="Configure vertical align top" stepKey="commentConfigureVerticalAlignTop"/>
483+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForFirstRow">
484+
<argument name="contentType" value="PageBuilderRowContentType"/>
485+
<argument name="contentTypeIndex" value="1"/>
486+
</actionGroup>
487+
<actionGroup ref="fillSlideOutPanelField" stepKey="enterMinHeightPropertyFirstRow">
488+
<argument name="property" value="PageBuilderMinHeightProperty_500"/>
489+
</actionGroup>
490+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmentTopProperty">
491+
<argument name="property" value="PageBuilderVerticalAlignmentPropertyTop"/>
492+
</actionGroup>
493+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsFirstRow"/>
494+
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToFirstRow">
495+
<argument name="contentType" value="PageBuilderHeadingContentType"/>
496+
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
497+
<argument name="containerTargetIndex" value="1"/>
498+
<argument name="contentTypeIndex" value="1"/>
499+
</actionGroup>
500+
<actionGroup ref="clickOutsideLiveEditHeading" stepKey="clickOutsideLiveEditHeading1">
501+
<argument name="index" value="1"/>
502+
</actionGroup>
503+
<!-- Configure Second Row - Vertical Align Center -->
504+
<comment userInput="Configure vertical align center" stepKey="commentConfigureVerticalAlignCenter"/>
505+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForSecondRow">
506+
<argument name="contentType" value="PageBuilderRowContentType"/>
507+
<argument name="contentTypeIndex" value="2"/>
508+
</actionGroup>
509+
<actionGroup ref="fillSlideOutPanelField" stepKey="enterMinHeightPropertySecondRow">
510+
<argument name="property" value="PageBuilderMinHeightProperty_300"/>
511+
</actionGroup>
512+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmenCenterProperty">
513+
<argument name="property" value="PageBuilderVerticalAlignmentPropertyCenter"/>
514+
</actionGroup>
515+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsSecondRow"/>
516+
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToSecondRow">
517+
<argument name="contentType" value="PageBuilderHeadingContentType"/>
518+
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
519+
<argument name="containerTargetIndex" value="2"/>
520+
<argument name="contentTypeIndex" value="1"/>
521+
</actionGroup>
522+
<scrollTo selector="{{CmsNewPagePageActionsSection.pageTitle}}" stepKey="scrollToTop"/>
523+
<actionGroup ref="clickOutsideLiveEditHeading" stepKey="clickOutsideLiveEditHeading2">
524+
<argument name="index" value="2"/>
525+
</actionGroup>
526+
<!--Configure Third Row - Vertical Align Bottom -->
527+
<comment userInput="Configure vertical align bottom" stepKey="commentConfigureVerticalAlignBottom"/>
528+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForThirdRow">
529+
<argument name="contentType" value="PageBuilderRowContentType"/>
530+
<argument name="contentTypeIndex" value="3"/>
531+
</actionGroup>
532+
<actionGroup ref="fillSlideOutPanelField" stepKey="enterMinHeightPropertyThirdRow">
533+
<argument name="property" value="PageBuilderMinHeightProperty_200"/>
534+
</actionGroup>
535+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmentBottomProperty">
536+
<argument name="property" value="PageBuilderVerticalAlignmentPropertyBottom"/>
537+
</actionGroup>
538+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsThirdColumn"/>
539+
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToThirdRow">
540+
<argument name="contentType" value="PageBuilderHeadingContentType"/>
541+
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
542+
<argument name="containerTargetIndex" value="3"/>
543+
<argument name="contentTypeIndex" value="1"/>
544+
</actionGroup>
545+
<!-- Verify Vertical Alignment On Stage - Before Save -->
546+
<comment userInput="Verify min height and vertical alignment on stage before save" stepKey="commentVerifyMinHeightAndVerticalAlignmentOnStageBeforeSave"/>
547+
<seeElement selector="{{RowOnStage.minHeight('1', PageBuilderMinHeightProperty_500.value)}}" stepKey="seeFirstRowMinHeight"/>
548+
<seeElement selector="{{RowOnStage.minHeight('2', PageBuilderMinHeightProperty_300.value)}}" stepKey="seeSecondRowMinHeight"/>
549+
<seeElement selector="{{RowOnStage.minHeight('3', PageBuilderMinHeightProperty_200.value)}}" stepKey="seeThirdRowMinHeight"/>
550+
<seeElement selector="{{RowOnStage.rowChildrenStyle('1', PageBuilderCommonStyles.verticalAlignmentTop)}}" stepKey="seeFirstRowVerticalAlignmentTop"/>
551+
<seeElement selector="{{RowOnStage.rowChildrenStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeSecondRowVerticalAlignmentCenter"/>
552+
<seeElement selector="{{RowOnStage.rowChildrenStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeThirdRowVerticalAlignmentBottom"/>
553+
<!-- Verify Vertical Alignment On Stage - After Save -->
554+
<comment userInput="Verify min height and vertical alignment on stage after save" stepKey="commentVerifyMinHeightAndVerticalAlignmentOnStageAfterSave"/>
555+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
556+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
557+
<seeElement selector="{{RowOnStage.minHeight('1', PageBuilderMinHeightProperty_500.value)}}" stepKey="seeFirstRowMinHeightAfterSave"/>
558+
<seeElement selector="{{RowOnStage.minHeight('2', PageBuilderMinHeightProperty_300.value)}}" stepKey="seeSecondRowMinHeightAfterSave"/>
559+
<seeElement selector="{{RowOnStage.minHeight('3', PageBuilderMinHeightProperty_200.value)}}" stepKey="seeThirdRowMinHeightAfterSave"/>
560+
<seeElement selector="{{RowOnStage.rowChildrenStyle('1', PageBuilderCommonStyles.verticalAlignmentTop)}}" stepKey="seeFirstRowVerticalAlignmentTopAfterSave"/>
561+
<seeElement selector="{{RowOnStage.rowChildrenStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeSecondRowVerticalAlignmentCenterAfterSave"/>
562+
<seeElement selector="{{RowOnStage.rowChildrenStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeThirdRowVerticalAlignmentBottomAfterSave"/>
563+
<!-- Verify Min Height and Vertical Alignment In Storefront -->
564+
<comment userInput="Verify min height and vertical alignment in storefront" stepKey="commentVerifyMinHeightAndVerticalAlignmentInStorefront"/>
565+
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
566+
<argument name="contentType" value="PageBuilderRowContentType"/>
567+
</actionGroup>
568+
<seeElement selector="{{RowOnStorefront.rowStyle('1', PageBuilderCommonStyles.minHeight500)}}" stepKey="seeRow1MinHeightApplied"/>
569+
<seeElement selector="{{RowOnStorefront.rowStyle('2', PageBuilderCommonStyles.minHeight300)}}" stepKey="seeRow2MinHeightApplied"/>
570+
<seeElement selector="{{RowOnStorefront.rowStyle('3', PageBuilderCommonStyles.minHeight200)}}" stepKey="seeRow3MinHeightApplied"/>
571+
<seeElement selector="{{RowOnStorefront.rowStyle('1', PageBuilderCommonStyles.verticalAlignmentTop)}}" stepKey="seeRow1VerticalAlignmentTopApplied"/>
572+
<seeElement selector="{{RowOnStorefront.rowStyle('2', PageBuilderCommonStyles.verticalAlignmentCenter)}}" stepKey="seeRow2VerticalAlignmentCenterApplied"/>
573+
<seeElement selector="{{RowOnStorefront.rowStyle('3', PageBuilderCommonStyles.verticalAlignmentBottom)}}" stepKey="seeRow3VerticalAlignmentBottomApplied"/>
574+
</test>
450575
<test name="RowValidateAdvancedConfigurationDefaultValues">
451576
<annotations>
452577
<features value="Pagebuilder: Row"/>

0 commit comments

Comments
 (0)