Skip to content

Commit b74d036

Browse files
author
Hwashiang Yu
committed
MC-34648: Update TinyMCE
- Corrected deprecation for mftf
1 parent c60bb17 commit b74d036

File tree

3 files changed

+150
-14
lines changed

3 files changed

+150
-14
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
@@ -79,9 +79,9 @@
7979
<argument name="variable" defaultValue=""/>
8080
</arguments>
8181
<comment userInput="Adding Variable To TinyMCE3" stepKey="commentAddVariableToTinyMCE"/>
82-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3VariableBtn}}" stepKey="waitForInsertVariable1"/>
83-
<click selector="{{TextOnConfiguration.tinyMCE3VariableBtn}}" stepKey="clickInsertVariable1"/>
84-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3VariableBtn}}" stepKey="waitForVariableModalToClose"/>
82+
<comment userInput="removing deprecated element" stepKey="waitForInsertVariable1"/>
83+
<comment userInput="removing deprecated element" stepKey="clickInsertVariable1"/>
84+
<comment userInput="removing deprecated element" stepKey="waitForVariableModalToClose"/>
8585
</actionGroup>
8686
<actionGroup name="addPageLinkVariableWYSIWYGDisabled">
8787
<arguments>
@@ -141,9 +141,9 @@
141141
<argument name="page" defaultValue="" type="string"/>
142142
</arguments>
143143
<comment userInput="Adding Widget To TinyMCE3" stepKey="commentAddWidget"/>
144-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="waitForInsertWidget1"/>
145-
<click selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="clickAddWidgetBtn"/>
146-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="waitForInsertWidgetModalToClose"/>
144+
<comment userInput="removing deprecated element" stepKey="waitForInsertWidget1"/>
145+
<comment userInput="removing deprecated element" stepKey="clickAddWidgetBtn"/>
146+
<comment userInput="removing deprecated element" stepKey="waitForInsertWidgetModalToClose"/>
147147
</actionGroup>
148148
<actionGroup name="addPageLinkWidgetWYSIWYGDisabled" extends="addPageLinkWidgetToTinyMCE">
149149
<arguments>

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,9 @@
6060
<element name="tinyMCEVariable" type="text" selector="(//body//span[contains(@class,'magento-variable') and .='{{arg1}}'])[{{arg2}}]" parameterized="true"/>
6161
<element name="tinyMCEWidget" type="text" selector="(//body//span[contains(@class,'magento-widget') and .='{{arg1}}'])[{{arg2}}]" parameterized="true"/>
6262
<element name="tinyMCEImage" type="text" selector="//img[contains(@src,'{{arg}}')]" parameterized="true"/>
63-
<!-- Deprecated this version of TinyMCE is no longer supported, please use tinyMCE-->
64-
<element name="tinyMCE3" type="text" selector="#pagebuilder_text_form_content_tbl"/>
65-
<!-- Deprecated this version of TinyMCE is no longer supported, please use tinyMCEVariableBtn-->
66-
<element name="tinyMCE3VariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable"/>
67-
<!-- Deprecated this version of TinyMCE is no longer supported, please use tinyMCEWidgetBtn-->
68-
<element name="tinyMCE3WidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget"/>
63+
<element name="tinyMCE3" type="text" selector="#pagebuilder_text_form_content_tbl" deprecated="this version of TinyMCE is no longer supported, please use tinyMCE"/>
64+
<element name="tinyMCE3VariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable" deprecated="this version of TinyMCE is no longer supported, please use tinyMCEVariableBtn"/>
65+
<element name="tinyMCE3WidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget" deprecated="this version of TinyMCE is no longer supported, please use tinyMCEWidgetBtn"/>
6966
<element name="tinyMCE" type="text" selector="#pagebuilder_text_form_content_tbl"/>
7067
<element name="tinyMCEVariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable"/>
7168
<element name="tinyMCEWidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget"/>

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

Lines changed: 141 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="TextDataConsistencyBetweenTextEditor">
11+
<test name="TextDataConsistencyBetweenTextEditor" deprecated="This version of TinyMCE is no longer supported">
1212
<annotations>
1313
<features value="PageBuilder"/>
1414
<stories value="Text"/>
@@ -19,6 +19,9 @@
1919
<testCaseId value="MC-3741"/>
2020
<group value="pagebuilder"/>
2121
<group value="pagebuilder-text"/>
22+
<skip>
23+
<issueId value="DEPRECATED">This version of TinyMCE is no longer supported</issueId>
24+
</skip>
2225
</annotations>
2326
<before>
2427
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
@@ -95,6 +98,17 @@
9598
<seeElement selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetValue"/>
9699
<seeElement selector="{{TextOnStage.widgetPlaceholder('1')}}" stepKey="waitForWidgetPlaceholder"/>
97100
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage4"/>
101+
<!-- Switch to TinyMCE3 -->
102+
<comment userInput="Switch to TinyMCE3" stepKey="comment6"/>
103+
<magentoCLI command="config:set cms/wysiwyg/editor Magento_Tinymce3/tinymce3Adapter" stepKey="enableTinyMCE3"/>
104+
<reloadPage stepKey="reloadPage1"/>
105+
<waitForPageLoad stepKey="waitForPageToBeLoaded1"/>
106+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4"/>
107+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="actualData"/>
108+
<assertEquals stepKey="assertTextValue">
109+
<expectedResult type="variable">expectedData</expectedResult>
110+
<actualResult type="variable">actualData</actualResult>
111+
</assertEquals>
98112
<!-- Switch to Textarea -->
99113
<comment userInput="Switch to Textarea" stepKey="comment7"/>
100114
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
@@ -133,6 +147,131 @@
133147
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4_2"/>
134148
<seeElement selector="{{TextOnStage.tinymce('1')}}{{CmsWYSIWYGSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSourceOnStage2"/>
135149
</test>
150+
<test name="TextDataConsistencyBetweenTextEditorWithoutTinyMCE3">
151+
<annotations>
152+
<features value="PageBuilder"/>
153+
<stories value="Text"/>
154+
<title value="Data consistency between TextArea, TinyMCE4, TinyMCE4 in PageBuilder stage"/>
155+
<description value="Verify data consistent when switching between TinyMCE versions and TextArea"/>
156+
<severity value="AVERAGE"/>
157+
<useCaseId value="MC-36390"/>
158+
<testCaseId value="MC-36391"/>
159+
<group value="pagebuilder"/>
160+
<group value="pagebuilder-text"/>
161+
</annotations>
162+
<before>
163+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
164+
<createData entity="_defaultCmsPage" stepKey="createCMSPageB" />
165+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
166+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
167+
</before>
168+
<after>
169+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG1"/>
170+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4_1"/>
171+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
172+
<deleteData createDataKey="createCMSPageB" stepKey="deletePreReqCMSPageB" />
173+
<actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/>
174+
<actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder">
175+
<argument name="FolderName" value="{{ImageFolder.name}}"/>
176+
</actionGroup>
177+
<actionGroup ref="DeleteImageFromStorageActionGroup" stepKey="DeleteImageFromStorage">
178+
<argument name="Image" value="ImageUpload3"/>
179+
</actionGroup>
180+
<actionGroup ref="logout" stepKey="logout"/>
181+
</after>
182+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1">
183+
<argument name="CMSPage" value="$$createCMSPage$$"/>
184+
</actionGroup>
185+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection1">
186+
<argument name="contentType" value="PageBuilderTextContentType"/>
187+
</actionGroup>
188+
<actionGroup ref="dragContentTypeToStage" stepKey="dragButtonsOntoStage">
189+
<argument name="contentType" value="PageBuilderTextContentType"/>
190+
</actionGroup>
191+
<click selector="{{TextOnStage.textareaPlaceholder('1')}}" stepKey="focusOnEditorArea"/>
192+
<fillField selector="{{TextOnStage.textareaPlaceholder('1')}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="fillTextToTextarea"/>
193+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="lostFocusFromTextarea"/>
194+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage2"/>
195+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
196+
<!--Verify Text Content Type on stage after saving cms page-->
197+
<comment userInput="Verify text content type on stage" stepKey="commentVerifyTextOnStage"/>
198+
<waitForElementVisible selector="{{TextOnStage.textArea('1')}}" stepKey="waitForTextStage2"/>
199+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValueAfterSaving"/>
200+
<assertEquals stepKey="assertTextValueAfterSaving">
201+
<expectedResult type="string">{{PageBuilderTextProperty.value}}</expectedResult>
202+
<actualResult type="variable">textareaValueAfterSaving</actualResult>
203+
</assertEquals>
204+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
205+
<argument name="contentType" value="PageBuilderTextContentType"/>
206+
</actionGroup>
207+
<!-- Add widget to TextArea -->
208+
<comment userInput="Add widget to TextArea" stepKey="comment2"/>
209+
<actionGroup ref="addPageLinkWidgetWYSIWYGDisabled" stepKey="addPageLinkWidgetWYSIWYGDisabled">
210+
<argument name="widget" value="PageBuilderTextArea_WidgetCMSPageLink"/>
211+
<argument name="page" value="$$createCMSPageB.identifier$$"/>
212+
</actionGroup>
213+
<!-- Add variable to TextArea -->
214+
<comment userInput="Add variable to TextArea" stepKey="comment3"/>
215+
<actionGroup ref="addPageLinkVariableWYSIWYGDisabled" stepKey="addPageLinkVariableWYSIWYGDisabled">
216+
<argument name="variable" value="PageBuilderTextArea_VariableBaseURL"/>
217+
</actionGroup>
218+
<executeJS function="return document.getElementById('{{TextOnConfiguration.textAreaId}}').value;" stepKey="expectedData"/>
219+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
220+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage3"/>
221+
<!-- Switch to TinyMCE4 -->
222+
<comment userInput="Switch to TinyMCE4 " stepKey="comment4"/>
223+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/>
224+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4"/>
225+
<!-- Verify data on TinyMCE4 -->
226+
<comment userInput="Verify data on TinyMCE4" stepKey="comment5"/>
227+
<reloadPage stepKey="reloadPage"/>
228+
<waitForPageLoad stepKey="waitForPageLoad"/>
229+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage3"/>
230+
<seeElement selector="{{TextOnStage.tinymce('1')}}" stepKey="waitforTinyMCE4"/>
231+
<seeElement selector="{{TextOnStage.text('1', PageBuilderTextProperty.value)}}" stepKey="waitForText"/>
232+
<seeElement selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariabBaseURL"/>
233+
<seeElement selector="{{TextOnStage.variablePlaceholder('1')}}" stepKey="waitForVariablePlaceholder"/>
234+
<seeElement selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetValue"/>
235+
<seeElement selector="{{TextOnStage.widgetPlaceholder('1')}}" stepKey="waitForWidgetPlaceholder"/>
236+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage4"/>
237+
<!-- Switch to Textarea -->
238+
<comment userInput="Switch to Textarea" stepKey="comment7"/>
239+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
240+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4_1"/>
241+
<reloadPage stepKey="reloadPage2"/>
242+
<waitForPageLoad stepKey="waitForPageToBeLoaded2"/>
243+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4_1"/>
244+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
245+
<argument name="contentType" value="PageBuilderTextContentType"/>
246+
</actionGroup>
247+
<fillField selector="{{TextOnConfiguration.textArea}}" userInput="" stepKey="clearTextContent"/>
248+
<!-- Add image to TextArea -->
249+
<comment userInput="Add image to TextArea" stepKey="comment8"/>
250+
<waitForElementVisible selector="{{TextOnConfiguration.insertImageButton}}" stepKey="waitForInsertImage"/>
251+
<click selector="{{TextOnConfiguration.insertImageButton}}" stepKey="clickInsertImage"/>
252+
<waitForPageLoad stepKey="waitForPageLoad1"/>
253+
<click selector="{{MediaGallerySection.StorageRootArrow}}" stepKey="clickStorageRoot"/>
254+
<waitForPageLoad stepKey="waitForPageLoad2"/>
255+
<actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder">
256+
<argument name="ImageFolder" value="ImageFolder"/>
257+
</actionGroup>
258+
<actionGroup ref="AttachImageActionGroup" stepKey="attachImage1">
259+
<argument name="Image" value="ImageUpload3"/>
260+
</actionGroup>
261+
<actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/>
262+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings1"/>
263+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage5"/>
264+
<!-- Switch to TinyMCE4 -->
265+
<comment userInput="Switch to TinyMCE4 " stepKey="comment9"/>
266+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG1"/>
267+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4_2"/>
268+
<!-- Verify image on TinyMCE4 -->
269+
<comment userInput="Verify data on TinyMCE4" stepKey="comment10"/>
270+
<reloadPage stepKey="reloadPage3"/>
271+
<waitForPageLoad stepKey="waitForPageToBeLoaded3"/>
272+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4_2"/>
273+
<seeElement selector="{{TextOnStage.tinymce('1')}}{{CmsWYSIWYGSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSourceOnStage2"/>
274+
</test>
136275
<test name="TextAreaInitalStatus">
137276
<annotations>
138277
<features value="PageBuilder"/>
@@ -292,7 +431,7 @@
292431
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
293432
<argument name="contentType" value="PageBuilderTextContentType"/>
294433
</actionGroup>
295-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="waitForTinyMCE3"/>
434+
<comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/>
296435
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame1"/>
297436
<!-- Verify inputed text is carried out to slideout -->
298437
<comment userInput="Verify inputed text is carried out to slideout" stepKey="comment1"/>

0 commit comments

Comments
 (0)