Skip to content

Commit a578f00

Browse files
committed
MC-3908: Dragging a text content block into the stage causes global styles to be changed and fonts to flash
- Fixing issues in CR
1 parent efb35d3 commit a578f00

File tree

5 files changed

+35
-44
lines changed

5 files changed

+35
-44
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<argument name="variable" defaultValue=""/>
2828
</arguments>
2929
<comment userInput="Adding Variable To Tiny MCE" stepKey="commentAddVariableToTinyMCE"/>
30-
<waitForElementVisible selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertVariableIcon}}" stepKey="waitForInsertVariable1"/>
31-
<click selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertVariableIcon}}" stepKey="clickInsertVariable1"/>
30+
<waitForElementVisible selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{TinyMCESection.InsertVariableIcon}}" stepKey="waitForInsertVariable1"/>
31+
<click selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{TinyMCESection.InsertVariableIcon}}" stepKey="clickInsertVariable1"/>
3232
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
3333
<waitForElementVisible selector="{{VariableSection.Radio(variable.variableName)}}" stepKey="waitForVariable1"/>
3434
<checkOption selector="{{VariableSection.Radio(variable.variableName)}}" stepKey="selectVariable"/>
@@ -71,8 +71,8 @@
7171
<argument name="page" defaultValue="" type="string"/>
7272
</arguments>
7373
<comment userInput="Adding Widget To Tiny MCE" stepKey="commentAddWidget"/>
74-
<waitForElementVisible selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1"/>
75-
<click selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
74+
<waitForElementVisible selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1"/>
75+
<click selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
7676
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
7777
<waitForElementVisible selector="{{WidgetSection.WidgetType}}" stepKey="waitForWidgetType"/>
7878
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="{{TinyMCEWidgetCMSPageLink.widgetType}}" stepKey="selectCMSPageLinkWidget"/>
@@ -139,8 +139,8 @@
139139
<argument name="title" type="string" defaultValue=""/>
140140
</arguments>
141141
<comment userInput="insertLinkInWYSIWYG" stepKey="comment"/>
142-
<waitForElementVisible selector="{{WYSIWYGInline.notCss}} {{section.InsertLink}}" stepKey="waitForInsertLinkButton"/>
143-
<click selector="{{WYSIWYGInline.notCss}} {{section.InsertLink}}" stepKey="clickInsertLinkButton"/>
142+
<waitForElementVisible selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{section.InsertLink}}" stepKey="waitForInsertLinkButton"/>
143+
<click selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{section.InsertLink}}" stepKey="clickInsertLinkButton"/>
144144
<waitForPageLoad stepKey="waitForPageLoad"/>
145145
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForInsertLinkModal"/>
146146
<fillField selector="{{WYSIWYGInsertLinkModal.urlInput}}" userInput="{{url}}" stepKey="insertUrl"/>

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
<element name="tinyMCE3" type="text" selector="#pagebuilder_text_form_content_tbl"/>
5656
<element name="tinyMCE3VariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable"/>
5757
<element name="tinyMCE3WidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget"/>
58-
<element name="panelFieldValidationErrorMessage" type="button" selector="//div[contains(@class,'_insert_form')]//div[@data-index='{{arg1}}']//div[contains(@class,'admin__control-wysiwig')]//..//../label[.='{{arg2}}']" parameterized="true"/>
5958
<!-- WYSIWYG Disabled -->
6059
<element name="textArea" type="text" selector="#pagebuilder_text_form_content"/>
6160
<element name="textAreaId" type="text" selector="pagebuilder_text_form_content"/>
@@ -96,35 +95,9 @@
9695
<element name="noPadding" type="text" selector="(//div[@data-role='text'])[{{arg1}}][not(contains(@style,'padding:'))]" parameterized="true"/>
9796
<element name="emptyText" type="text" selector="//div[@data-role='text']/p[not(text())]"/>
9897
</section>
99-
<section name="TextOnBackend">
100-
<element name="textInstance" type="button" selector='//div[contains(@class, "pagebuilder-text")][1]/div[1]'/>
101-
<element name="textArea" type="text" selector='#pagebuilder_text_form_content'/>
102-
<element name="triggerValidation" type="button" selector='div.modal-content div.mce-edit-area'/>
103-
</section>
104-
<section name="TextOnSlider">
105-
<element name="textArea" type="text" selector="#pagebuilder_slide_form_content"/>
106-
</section>
10798
<!-- Move the below elements to CE after code freeze -->
10899
<section name="moveToCE">
109100
<element name="SelectPageButton" type="button" selector="//button[@title='Select Page...']"/>
110101
<element name="generalFilter" type="input" selector="input.admin__control-text[name='{{arg1}}']" parameterized="true"/>
111102
</section>
112-
<section name="WYSIWYGOnPageBuilder">
113-
<element name="undo" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Undo']"/>
114-
<element name="redo" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Redo']"/>
115-
<element name="fontSize" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Font Sizes']"/>
116-
<element name="lineHeight" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Line Height']"/>
117-
<element name="textColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Text color']"/>
118-
<element name="backgroundColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Background color']"/>
119-
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce') and not(contains(@class, 'mce-tinymce-inline'))]//span[text()='Formats']"/>
120-
</section>
121-
<section name="WYSIWYGOnPageBuilderInline">
122-
<element name="undo" type="button" selector=".mce-tinymce-inline div[aria-label='Undo']"/>
123-
<element name="redo" type="button" selector=".mce-tinymce-inline div[aria-label='Redo']"/>
124-
<element name="fontSize" type="button" selector=".mce-tinymce-inline div[aria-label='Font Sizes']"/>
125-
<element name="lineHeight" type="button" selector=".mce-tinymce-inline div[aria-label='Line Height']"/>
126-
<element name="textColor" type="button" selector=".mce-tinymce-inline div[aria-label='Text color']"/>
127-
<element name="backgroundColor" type="button" selector=".mce-tinymce-inline div[aria-label='Background color']"/>
128-
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce')]//span[text()='Formats']"/>
129-
</section>
130103
</sections>

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11-
<section name="WYSIWYGInline">
12-
<element name="notCss" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline)"/>
13-
</section>
1411
<section name="WYSIWYGInsertLinkModal">
1512
<element name="modal" type="input" selector="[aria-label='Insert link']"/>
1613
<element name="title" type="input" selector="//div[@aria-label='Insert link']//div[contains(@id,'-title') and .='Insert link']"/>
@@ -23,4 +20,23 @@
2320
<element name="okButton" type="button" selector="//div[@aria-label='Insert link']//button//span[.='Ok']"/>
2421
<element name="cancelButton" type="button" selector="//div[@aria-label='Insert link']//button//span[.='Cancel']"/>
2522
</section>
23+
<section name="WYSIWYGOnPageBuilder">
24+
<element name="undo" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Undo']"/>
25+
<element name="redo" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Redo']"/>
26+
<element name="fontSize" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Font Sizes']"/>
27+
<element name="lineHeight" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Line Height']"/>
28+
<element name="textColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Text color']"/>
29+
<element name="backgroundColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Background color']"/>
30+
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce') and not(contains(@class, 'mce-tinymce-inline'))]//span[text()='Formats']"/>
31+
</section>
32+
<section name="WYSIWYGOnPageBuilderInline">
33+
<element name="notCss" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline)"/>
34+
<element name="undo" type="button" selector=".mce-tinymce-inline div[aria-label='Undo']"/>
35+
<element name="redo" type="button" selector=".mce-tinymce-inline div[aria-label='Redo']"/>
36+
<element name="fontSize" type="button" selector=".mce-tinymce-inline div[aria-label='Font Sizes']"/>
37+
<element name="lineHeight" type="button" selector=".mce-tinymce-inline div[aria-label='Line Height']"/>
38+
<element name="textColor" type="button" selector=".mce-tinymce-inline div[aria-label='Text color']"/>
39+
<element name="backgroundColor" type="button" selector=".mce-tinymce-inline div[aria-label='Background color']"/>
40+
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce')]//span[text()='Formats']"/>
41+
</section>
2642
</sections>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,19 @@
238238
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
239239
<waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" />
240240
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" />
241-
<waitForPageLoad stepKey="waitForPageLoad2" />
241+
<waitForPageLoad stepKey="waitForPageLoad1" />
242242
<click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse" />
243-
<waitForPageLoad stepKey="waitForPageLoad3" />
243+
<waitForPageLoad stepKey="waitForPageLoad2" />
244244
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1" />
245245
<click selector="{{MediaGallerySection.CreateFolder}}" stepKey="createFolder"/>
246246
<waitForElementVisible selector="{{MediaGallerySection.FolderName}}" stepKey="waitForPopup" />
247247
<fillField selector="{{MediaGallerySection.FolderName}}" userInput="{{ImageFolder.name}}" stepKey="fillFolderName" />
248248
<click selector="{{MediaGallerySection.AcceptFolderName}}" stepKey="acceptFolderName" />
249249
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2" />
250250
<conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickStorageRootArrowIfClosed" visible="true"/>
251+
<waitForPageLoad stepKey="waitForPageLoad3"/>
251252
<conditionalClick selector="{{MediaGallerySection.WysiwygArrow}}" dependentSelector="{{MediaGallerySection.checkIfWysiwygArrowExpand}}" stepKey="clickWysiwygArrowIfClosed" visible="true"/>
253+
<waitForPageLoad stepKey="waitForPageLoad4"/>
252254
<waitForText userInput="{{ImageFolder.name}}" stepKey="waitForNewFolder" />
253255
<click userInput="{{ImageFolder.name}}" stepKey="clickOnCreatedFolder" />
254256
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3" />
@@ -263,7 +265,7 @@
263265
<fillField selector="{{MediaGallerySection.ImageDescription}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription" />
264266
<fillField selector="{{MediaGallerySection.Height}}" userInput="{{ImageUpload.height}}" stepKey="fillImageHeight" />
265267
<click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn" />
266-
<waitForPageLoad stepKey="waitForPageLoad4"/>
268+
<waitForPageLoad stepKey="waitForPageLoad5"/>
267269
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
268270
<actionGroup ref="enablePageBuilderSetting" stepKey="enablePageBuilder"/>
269271
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToContentCreatedCMSPage2">

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@
5757
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
5858
<argument name="contentType" value="PageBuilderTextContentType"/>
5959
</actionGroup>
60-
<waitForLoadingMaskToDisappear stepKey="waitForEditPanelSpinner"/>
61-
<executeJS function="tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'This is some text')" stepKey="addTextToWYSIWYG"/>
62-
<click selector="{{TextOnBackend.triggerValidation}}" stepKey="clickToTriggerValidation"/>
63-
<waitForLoadingMaskToDisappear stepKey="waitForSpinner"/>
60+
<actionGroup ref="addTextToTinyMCE" stepKey="enterText">
61+
<argument name="property" value="PageBuilderTextProperty"/>
62+
</actionGroup>
6463
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
6564
<!-- Verify Tab Height Adjusts to Content - Depends on MQE-818 -->
6665
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
6766
<!-- Verify Text in Tab on storefront -->
6867
<comment userInput="View Tab on storefront" stepKey="viewTabOnStorefront"/>
6968
<amOnPage url="tabs{{PageBuilderPageTitle.pageName}}" stepKey="amOnPageBuilderPage"/>
70-
<see userInput="This is some text" stepKey="assertTextOnStorefront"/>
69+
<waitForPageLoad stepKey="waitForPageLoad"/>
70+
<see userInput="{{PageBuilderTextProperty.value}}" stepKey="assertTextOnStorefront"/>
7171
</test>
7272
<test name="CanAddContentTypeToTab">
7373
<annotations>

0 commit comments

Comments
 (0)