Skip to content

Commit 8eda0c1

Browse files
committed
MC-3908: Dragging a text content block into the stage causes global styles to be changed and fonts to flash
- Fix test failures
1 parent 470f6c1 commit 8eda0c1

File tree

5 files changed

+35
-14
lines changed

5 files changed

+35
-14
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<click selector="{{VariableSection.InsertWidget}}" stepKey="clickInsertVariable2"/>
3737
<waitForElementNotVisible selector="{{VariableSection.InsertWidget}}" stepKey="waitForVariableModalToClose"/>
3838
</actionGroup>
39+
<actionGroup name="addVariableToTinyMCEInline" extends="addVariableToTinyMCE">
40+
<waitForElementVisible selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="waitForInsertVariable1"/>
41+
<click selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="clickInsertVariable1"/>
42+
</actionGroup>
3943
<actionGroup name="addVariableToTinyMCE3" extends="addVariableToTinyMCE">
4044
<arguments>
4145
<argument name="variable" defaultValue=""/>
@@ -90,6 +94,10 @@
9094
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear5"/>
9195
<waitForElementNotVisible selector="{{WidgetSection.InsertWidget}}" stepKey="waitForInsertWidgetModalToClose"/>
9296
</actionGroup>
97+
<actionGroup name="addPageLinkWidgetToTinyMCEInline" extends="addPageLinkWidgetToTinyMCE">
98+
<waitForElementVisible selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1"/>
99+
<click selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
100+
</actionGroup>
93101
<actionGroup name="addPageLinkWidgetToTinyMCE3" extends="addPageLinkWidgetToTinyMCE">
94102
<arguments>
95103
<argument name="widget" defaultValue=""/>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,12 @@
117117
<element name="backgroundColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Background color']"/>
118118
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce') and not(contains(@class, 'mce-tinymce-inline'))]//span[text()='Formats']"/>
119119
</section>
120+
<section name="WYSIWYGOnPageBuilderInline">
121+
<element name="undo" type="button" selector=".mce-tinymce-inline div[aria-label='Undo']"/>
122+
<element name="redo" type="button" selector=".mce-tinymce-inline div[aria-label='Redo']"/>
123+
<element name="fontSize" type="button" selector=".mce-tinymce-inline div[aria-label='Font Sizes']"/>
124+
<element name="textColor" type="button" selector=".mce-tinymce-inline div[aria-label='Text color']"/>
125+
<element name="backgroundColor" type="button" selector=".mce-tinymce-inline div[aria-label='Background color']"/>
126+
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce')]//span[text()='Formats']"/>
127+
</section>
120128
</sections>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@
187187
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
188188
<argument name="group" value="PageBuilderTextContentType"/>
189189
</actionGroup>
190-
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit"/>
191190
<actionGroup ref="dragContentTypeToContainer" stepKey="dragTextIntoStage1">
192191
<argument name="contentType" value="PageBuilderTextContentType"/>
193192
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
194193
<argument name="containerTargetIndex" value="1"/>
195194
<argument name="contentTypeIndex" value="1"/>
196195
</actionGroup>
196+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit1"/>
197197
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage1">
198198
<argument name="contentType" value="PageBuilderTextContentType"/>
199199
<argument name="contentTypeIndex" value="1"/>
@@ -213,6 +213,7 @@
213213
<argument name="containerTargetIndex" value="2"/>
214214
<argument name="contentTypeIndex" value="2"/>
215215
</actionGroup>
216+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit2"/>
216217
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage2">
217218
<argument name="contentType" value="PageBuilderTextContentType"/>
218219
<argument name="contentTypeIndex" value="2"/>
@@ -232,6 +233,7 @@
232233
<argument name="containerTargetIndex" value="3"/>
233234
<argument name="contentTypeIndex" value="3"/>
234235
</actionGroup>
236+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit3"/>
235237
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage3">
236238
<argument name="contentType" value="PageBuilderTextContentType"/>
237239
<argument name="contentTypeIndex" value="3"/>
@@ -251,6 +253,7 @@
251253
<argument name="containerTargetIndex" value="4"/>
252254
<argument name="contentTypeIndex" value="4"/>
253255
</actionGroup>
256+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit4"/>
254257
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage4">
255258
<argument name="contentType" value="PageBuilderTextContentType"/>
256259
<argument name="contentTypeIndex" value="4"/>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,6 +2526,8 @@
25262526
<actionGroup ref="dragContentTypeToStage" stepKey="dragTextOntoStage">
25272527
<argument name="contentType" value="PageBuilderTextContentType"/>
25282528
</actionGroup>
2529+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit"/>
2530+
<click selector="{{SlideOnBackend.tinymce('1')}}" stepKey="focusOnEditorArea1"/>
25292531
<seeElement selector="{{SlideOnBackend.tinymcePanel('1')}}" stepKey="panelVisible1"/>
25302532
<!-- Check that user can drag column when inline mode active -->
25312533
<comment userInput="Check that user can drag column when inline mode active" stepKey="commentDragColumnIntoStage"/>

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@
420420
<!--Input variable into stage-->
421421
<comment userInput="Input variable into stage" stepKey="commentInputVariableIntoStage"/>
422422
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea1"/>
423-
<actionGroup ref="addVariableToTinyMCE" stepKey="addVariableToTinyMCE">
423+
<actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE">
424424
<argument name="variable" value="TinyMCEVariableBaseURL"/>
425425
</actionGroup>
426426
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariableBaseURLStage"/>
@@ -437,7 +437,7 @@
437437
<!--Input widget into stage-->
438438
<comment userInput="Input widget into stage" stepKey="commentInputWidgetIntoStage"/>
439439
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea2"/>
440-
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
440+
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
441441
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
442442
<argument name="page" value="$$createCMSPageB.identifier$$"/>
443443
</actionGroup>
@@ -682,7 +682,7 @@
682682
<argument name="contentType" value="PageBuilderTextContentType"/>
683683
</actionGroup>
684684
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
685-
<actionGroup ref="addVariableToTinyMCE" stepKey="addVariableToTinyMCE">
685+
<actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE">
686686
<argument name="variable" value="TinyMCEVariableCountry"/>
687687
</actionGroup>
688688
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEVariableCountry.editPanelValue)}}" stepKey="waitForVariableCountryStage1"/>
@@ -749,7 +749,7 @@
749749
<argument name="contentType" value="PageBuilderTextContentType"/>
750750
</actionGroup>
751751
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
752-
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
752+
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
753753
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
754754
<argument name="page" value="$$createCMSPageB.identifier$$"/>
755755
</actionGroup>
@@ -816,14 +816,14 @@
816816
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
817817
<actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE4"/>
818818
<actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/>
819-
<seeElement selector="{{WYSIWYGOnPageBuilder.undo}}" stepKey="seeUndo"/>
820-
<seeElement selector="{{WYSIWYGOnPageBuilder.redo}}" stepKey="seeRedo"/>
821-
<seeElement selector="{{WYSIWYGOnPageBuilder.fontSize}}" stepKey="seeFontsize"/>
822-
<seeElement selector="{{WYSIWYGOnPageBuilder.textColor}}" stepKey="seeTextColor"/>
823-
<seeElement selector="{{WYSIWYGOnPageBuilder.backgroundColor}}" stepKey="seeBackgroundColor"/>
819+
<seeElement selector="{{WYSIWYGOnPageBuilderInline.undo}}" stepKey="seeUndo"/>
820+
<seeElement selector="{{WYSIWYGOnPageBuilderInline.redo}}" stepKey="seeRedo"/>
821+
<seeElement selector="{{WYSIWYGOnPageBuilderInline.fontSize}}" stepKey="seeFontsize"/>
822+
<seeElement selector="{{WYSIWYGOnPageBuilderInline.textColor}}" stepKey="seeTextColor"/>
823+
<seeElement selector="{{WYSIWYGOnPageBuilderInline.backgroundColor}}" stepKey="seeBackgroundColor"/>
824824
<!--Verify FontSize-->
825825
<comment userInput="Verify FontSize" stepKey="commentVerifyFontSize"/>
826-
<click selector="{{WYSIWYGOnPageBuilder.fontSize}}" stepKey="clickOnFontSize"/>
826+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSize}}" stepKey="clickOnFontSize"/>
827827
<see userInput="10px" stepKey="see10px" />
828828
<see userInput="12px" stepKey="see12px" />
829829
<see userInput="14px" stepKey="see14px" />
@@ -848,7 +848,7 @@
848848
<comment userInput="Verify FontStyle on preview" stepKey="commentVerifyFontsizeOnPreview"/>
849849
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea"/>
850850
<fillField selector="{{TextOnStage.tinymce('1')}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="fillTextToTinyMCE4"/>
851-
<click selector="{{WYSIWYGOnPageBuilder.formatSelector}}" stepKey="expandFormatList"/>
851+
<click selector="{{WYSIWYGOnPageBuilderInline.formatSelector}}" stepKey="expandFormatList"/>
852852
<see userInput="Important" stepKey="seeImportantStyle"/>
853853
<click selector="{{TextOnStage.importantStyle('1')}}" stepKey="selectFormatStyle" />
854854
<seeElement selector="{{TextOnStage.textInImportantStyle('1',PageBuilderTextProperty.value)}}" stepKey="seeTextInImportantStyleOnPreview1" />
@@ -2105,7 +2105,7 @@
21052105
<!--Input variable into stage-->
21062106
<comment userInput="Input variable into stage" stepKey="commentInputVariableIntoStage"/>
21072107
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea1"/>
2108-
<actionGroup ref="addVariableToTinyMCE" stepKey="addVariableToTinyMCE">
2108+
<actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE">
21092109
<argument name="variable" value="TinyMCEVariableBaseURL"/>
21102110
</actionGroup>
21112111
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariableBaseURLStage"/>
@@ -2122,7 +2122,7 @@
21222122
<!--Input widget into stage-->
21232123
<comment userInput="Input widget into stage" stepKey="commentInputWidgetIntoStage"/>
21242124
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea2"/>
2125-
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
2125+
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
21262126
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
21272127
<argument name="page" value="$$createCMSPageB.identifier$$"/>
21282128
</actionGroup>

0 commit comments

Comments
 (0)