Skip to content

Commit 15f8a1c

Browse files
author
Hwashiang Yu
committed
MC-4254: Text Height Inconsistency On Stage & Storefront
- Removed min height from all of text content type - Added test coverage for this change
1 parent 28a01e8 commit 15f8a1c

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,4 +2609,52 @@
26092609
<waitForElementVisible selector="{{TextOnConfiguration.textArea}}" stepKey="waitForTextOnEditPanel" before="enterText"/>
26102610
<fillField selector="{{TextOnConfiguration.textArea}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="enterText"/>
26112611
</test>
2612+
<test name="TextHeightConsistencyBetweenStageAndStorefront">
2613+
<annotations>
2614+
<features value="PageBuilder"/>
2615+
<stories value="Text"/>
2616+
<title value="Height consistency PageBuilder stage and storefront"/>
2617+
<description value="Verify height consistent when switching between stage and storefront"/>
2618+
<severity value="AVERAGE"/>
2619+
<useCaseId value="MC-4254"/>
2620+
<testCaseId value="MC-6268"/>
2621+
<group value="pagebuilder"/>
2622+
<group value="pagebuilder-text"/>
2623+
</annotations>
2624+
<before>
2625+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
2626+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2627+
</before>
2628+
<after>
2629+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
2630+
<actionGroup ref="logout" stepKey="logout"/>
2631+
</after>
2632+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1">
2633+
<argument name="CMSPage" value="$$createCMSPage$$"/>
2634+
</actionGroup>
2635+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup1">
2636+
<argument name="group" value="PageBuilderTextContentType"/>
2637+
</actionGroup>
2638+
<actionGroup ref="dragContentTypeToStage" stepKey="dragButtonsOntoStage">
2639+
<argument name="contentType" value="PageBuilderTextContentType"/>
2640+
</actionGroup>
2641+
<!--Input text into stage-->
2642+
<comment userInput="Input text into stage" stepKey="commentInputTextIntoStage"/>
2643+
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea"/>
2644+
<pressKey selector="{{TextOnStage.tinymce('1')}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="fillTextToTinyMCE4"/>
2645+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="lostFocusFromWYSIWYG1"/>
2646+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.base('1'))}}&quot;, document.body).iterateNext().offsetHeight;" stepKey="getTextOnStageHeight"/>
2647+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
2648+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
2649+
<!--Get storefront information-->
2650+
<comment userInput="Get storefront information" stepKey="commentGetStorefrontInformation"/>
2651+
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
2652+
<waitForPageLoad stepKey="waitForStorefront"/>
2653+
<waitForElement selector="{{TextOnStorefront.base('1')}}" stepKey="waitForTextOnStorefront"/>
2654+
<executeJS function="return document.evaluate(&quot;{{TextOnStorefront.base('1'))}}&quot;, document.body).iterateNext().offsetHeight;" stepKey="getTextOnStorefrontHeight"/>
2655+
<executeJS function="return Math.abs({$getTextOnStageHeight} - ${getTextOnStorefrontHeight}) &lt;= 2" stepKey="getStageAndStorefrontHeightDifference"/>
2656+
<assertTrue stepKey="assertStageAndStorefrontHeightAreClose">
2657+
<actualResult type="variable">getStageAndStorefrontHeightDifference</actualResult>
2658+
</assertTrue>
2659+
</test>
26122660
</tests>

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/text/_default.less

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
.pagebuilder-content-type.pagebuilder-text {
1111
border-width: 0;
12-
min-height: 70px;
1312

1413
ol {
1514
list-style: decimal;
@@ -24,13 +23,13 @@
2423
z-index: 20;
2524
}
2625
> .mce-content-body {
27-
min-height: 50px;
26+
overflow: auto;
2827

2928
+ .placeholder-text {
30-
left: 5px;
29+
left: 0;
3130
pointer-events: none;
3231
position: absolute;
33-
top: 5px;
32+
top: 0;
3433
}
3534

3635
img {
@@ -47,7 +46,6 @@
4746
.inline-wysiwyg-textarea {
4847
border: 0;
4948
margin: 2px 0;
50-
min-height: 50px;
5149
padding: 5px;
5250
resize: none;
5351
width: 100%;

0 commit comments

Comments
 (0)