Skip to content

Commit 8552491

Browse files
author
Hwashiang Yu
committed
MC-34647: Update TinyMCE
- Corrected deprecation for mftf
1 parent 6ce8f85 commit 8552491

File tree

6 files changed

+160
-14
lines changed

6 files changed

+160
-14
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<argument name="page" defaultValue="" type="string"/>
1313
</arguments>
1414
<comment userInput="Adding Widget To TinyMCE3" stepKey="commentAddWidget"/>
15-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="waitForInsertWidget1"/>
16-
<click selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="clickAddWidgetBtn"/>
17-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="waitForInsertWidgetModalToClose"/>
15+
<comment userInput="removing deprecated element" stepKey="waitForInsertWidget1"/>
16+
<comment userInput="removing deprecated element" stepKey="clickAddWidgetBtn"/>
17+
<comment userInput="removing deprecated element" stepKey="waitForInsertWidgetModalToClose"/>
1818
</actionGroup>
1919
</actionGroups>

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<argument name="variable" defaultValue=""/>
1313
</arguments>
1414
<comment userInput="Adding Variable To TinyMCE3" stepKey="commentAddVariableToTinyMCE"/>
15-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3VariableBtn}}" stepKey="waitForInsertVariable1"/>
16-
<click selector="{{TextOnConfiguration.tinyMCE3VariableBtn}}" stepKey="clickInsertVariable1"/>
17-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3VariableBtn}}" stepKey="waitForVariableModalToClose"/>
15+
<comment userInput="removing deprecated element" stepKey="waitForInsertVariable1"/>
16+
<comment userInput="removing deprecated element" stepKey="clickInsertVariable1"/>
17+
<comment userInput="removing deprecated element" stepKey="waitForVariableModalToClose"/>
1818
</actionGroup>
1919
</actionGroups>

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

+3-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
<element name="tinyMCEVariable" type="text" selector="(//body//span[contains(@class,'magento-variable') and .='{{arg1}}'])[{{arg2}}]" parameterized="true"/>
1515
<element name="tinyMCEWidget" type="text" selector="(//body//span[contains(@class,'magento-widget') and .='{{arg1}}'])[{{arg2}}]" parameterized="true"/>
1616
<element name="tinyMCEImage" type="text" selector="//img[contains(@src,'{{arg}}')]" parameterized="true"/>
17-
<!-- Deprecated TinyMCE3 is no long supported use tinyMCE -->
18-
<element name="tinyMCE3" type="text" selector="#pagebuilder_text_form_content_tbl"/>
19-
<!-- Deprecated TinyMCE3 is no long supported use tinyMCEVariableBtn -->
20-
<element name="tinyMCE3VariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable"/>
21-
<!-- Deprecated TinyMCE3 is no long supported use tinyMCEWidgetBtn -->
22-
<element name="tinyMCE3WidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget"/>
17+
<element name="tinyMCE3" type="text" selector="#pagebuilder_text_form_content_tbl" deprecated="TinyMCE3 is no long supported use tinyMCE"/>
18+
<element name="tinyMCE3VariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable" deprecated="TinyMCE3 is no long supported use tinyMCEVariableBtn"/>
19+
<element name="tinyMCE3WidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget" deprecated="TinyMCE3 is no long supported use tinyMCEWidgetBtn"/>
2320
<element name="tinyMCE" type="text" selector="#pagebuilder_text_form_content_tbl"/>
2421
<element name="tinyMCEVariableBtn" type="text" selector="#pagebuilder_text_form_content_magentovariable"/>
2522
<element name="tinyMCEWidgetBtn" type="text" selector="#pagebuilder_text_form_content_magentowidget"/>

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

+15-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="TextDataConsistencyBetweenTextEditorTest">
10+
<test name="TextDataConsistencyBetweenTextEditorTest" deprecated="TinyMCE3 is no longer supported">
1111
<annotations>
1212
<features value="PageBuilder"/>
1313
<stories value="Text"/>
@@ -18,6 +18,9 @@
1818
<testCaseId value="MC-3741"/>
1919
<group value="pagebuilder"/>
2020
<group value="pagebuilder-text"/>
21+
<skip>
22+
<issueId value="DEPRECATED">TinyMCE3 is no longer supported</issueId>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<createData entity="_defaultCmsPage" stepKey="createCMSPage"/>
@@ -94,6 +97,17 @@
9497
<seeElement selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetValue"/>
9598
<seeElement selector="{{TextOnStage.widgetPlaceholder('1')}}" stepKey="waitForWidgetPlaceholder"/>
9699
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage4"/>
100+
<!-- Switch to TinyMCE3 -->
101+
<comment userInput="Switch to TinyMCE3" stepKey="comment6"/>
102+
<magentoCLI command="config:set cms/wysiwyg/editor Magento_Tinymce3/tinymce3Adapter" stepKey="enableTinyMCE3"/>
103+
<reloadPage stepKey="reloadPage1"/>
104+
<waitForPageLoad stepKey="waitForPageToBeLoaded1"/>
105+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4"/>
106+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="actualData"/>
107+
<assertEquals stepKey="assertTextValue">
108+
<expectedResult type="variable">expectedData</expectedResult>
109+
<actualResult type="variable">actualData</actualResult>
110+
</assertEquals>
97111
<!-- Switch to Textarea -->
98112
<comment userInput="Switch to Textarea" stepKey="comment7"/>
99113
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="TextDataConsistencyBetweenTextEditorTest">
11+
<annotations>
12+
<features value="PageBuilder"/>
13+
<stories value="Text"/>
14+
<title value="Data consistency between TextArea, TinyMCE4, TinyMCE4 in PageBuilder stage"/>
15+
<description value="Verify data consistent when switching between TinyMCE versions and TextArea"/>
16+
<severity value="AVERAGE"/>
17+
<useCaseId value="MC-36390"/>
18+
<testCaseId value="MC-36391"/>
19+
<group value="pagebuilder"/>
20+
<group value="pagebuilder-text"/>
21+
</annotations>
22+
<before>
23+
<createData entity="_defaultCmsPage" stepKey="createCMSPage"/>
24+
<createData entity="_defaultCmsPage" stepKey="createCMSPageB"/>
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
26+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
27+
</before>
28+
<after>
29+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG1"/>
30+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4_1"/>
31+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage"/>
32+
<deleteData createDataKey="createCMSPageB" stepKey="deletePreReqCMSPageB"/>
33+
<actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/>
34+
<actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder">
35+
<argument name="FolderName" value="{{ImageFolder.name}}"/>
36+
</actionGroup>
37+
<actionGroup ref="DeleteImageFromStorageActionGroup" stepKey="DeleteImageFromStorage">
38+
<argument name="Image" value="ImageUpload3"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
41+
</after>
42+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1">
43+
<argument name="CMSPage" value="$$createCMSPage$$"/>
44+
</actionGroup>
45+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection1">
46+
<argument name="contentType" value="PageBuilderTextContentType"/>
47+
</actionGroup>
48+
<actionGroup ref="dragContentTypeToStage" stepKey="dragButtonsOntoStage">
49+
<argument name="contentType" value="PageBuilderTextContentType"/>
50+
</actionGroup>
51+
<click selector="{{TextOnStage.textareaPlaceholder('1')}}" stepKey="focusOnEditorArea"/>
52+
<fillField selector="{{TextOnStage.textareaPlaceholder('1')}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="fillTextToTextarea"/>
53+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="lostFocusFromTextarea"/>
54+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage2"/>
55+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
56+
<!--Verify Text Content Type on stage after saving cms page-->
57+
<comment userInput="Verify text content type on stage" stepKey="commentVerifyTextOnStage"/>
58+
<waitForElementVisible selector="{{TextOnStage.textArea('1')}}" stepKey="waitForTextStage2"/>
59+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValueAfterSaving"/>
60+
<assertEquals stepKey="assertTextValueAfterSaving">
61+
<expectedResult type="string">{{PageBuilderTextProperty.value}}</expectedResult>
62+
<actualResult type="variable">textareaValueAfterSaving</actualResult>
63+
</assertEquals>
64+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
65+
<argument name="contentType" value="PageBuilderTextContentType"/>
66+
</actionGroup>
67+
<!-- Add widget to TextArea -->
68+
<comment userInput="Add widget to TextArea" stepKey="comment2"/>
69+
<actionGroup ref="addPageLinkWidgetWYSIWYGDisabled" stepKey="addPageLinkWidgetWYSIWYGDisabled">
70+
<argument name="widget" value="PageBuilderTextArea_WidgetCMSPageLink"/>
71+
<argument name="page" value="$$createCMSPageB.identifier$$"/>
72+
</actionGroup>
73+
<!-- Add variable to TextArea -->
74+
<comment userInput="Add variable to TextArea" stepKey="comment3"/>
75+
<actionGroup ref="addPageLinkVariableWYSIWYGDisabled" stepKey="addPageLinkVariableWYSIWYGDisabled">
76+
<argument name="variable" value="PageBuilderTextArea_VariableBaseURL"/>
77+
</actionGroup>
78+
<executeJS function="return document.getElementById('{{TextOnConfiguration.textAreaId}}').value;" stepKey="expectedData"/>
79+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
80+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage3"/>
81+
<!-- Switch to TinyMCE4 -->
82+
<comment userInput="Switch to TinyMCE4 " stepKey="comment4"/>
83+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/>
84+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4"/>
85+
<!-- Verify data on TinyMCE4 -->
86+
<comment userInput="Verify data on TinyMCE4" stepKey="comment5"/>
87+
<reloadPage stepKey="reloadPage"/>
88+
<waitForPageLoad stepKey="waitForPageLoad"/>
89+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage3"/>
90+
<seeElement selector="{{TextOnStage.tinymce('1')}}" stepKey="waitforTinyMCE4"/>
91+
<seeElement selector="{{TextOnStage.text('1', PageBuilderTextProperty.value)}}" stepKey="waitForText"/>
92+
<seeElement selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariabBaseURL"/>
93+
<seeElement selector="{{TextOnStage.variablePlaceholder('1')}}" stepKey="waitForVariablePlaceholder"/>
94+
<seeElement selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetValue"/>
95+
<seeElement selector="{{TextOnStage.widgetPlaceholder('1')}}" stepKey="waitForWidgetPlaceholder"/>
96+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage4"/>
97+
<!-- Switch to Textarea -->
98+
<comment userInput="Switch to Textarea" stepKey="comment7"/>
99+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
100+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4_1"/>
101+
<reloadPage stepKey="reloadPage2"/>
102+
<waitForPageLoad stepKey="waitForPageToBeLoaded2"/>
103+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4_1"/>
104+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
105+
<argument name="contentType" value="PageBuilderTextContentType"/>
106+
</actionGroup>
107+
<fillField selector="{{TextOnConfiguration.textArea}}" userInput="" stepKey="clearTextContent"/>
108+
<!-- Add image to TextArea -->
109+
<comment userInput="Add image to TextArea" stepKey="comment8"/>
110+
<waitForElementVisible selector="{{TextOnConfiguration.insertImageButton}}" stepKey="waitForInsertImage"/>
111+
<click selector="{{TextOnConfiguration.insertImageButton}}" stepKey="clickInsertImage"/>
112+
<waitForPageLoad stepKey="waitForPageLoad1"/>
113+
<click selector="{{MediaGallerySection.StorageRootArrow}}" stepKey="clickStorageRoot"/>
114+
<waitForPageLoad stepKey="waitForPageLoad2"/>
115+
<actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder">
116+
<argument name="ImageFolder" value="ImageFolder"/>
117+
</actionGroup>
118+
<actionGroup ref="AttachImageActionGroup" stepKey="attachImage1">
119+
<argument name="Image" value="ImageUpload3"/>
120+
</actionGroup>
121+
<actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/>
122+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings1"/>
123+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage5"/>
124+
<!-- Switch to TinyMCE4 -->
125+
<comment userInput="Switch to TinyMCE4 " stepKey="comment9"/>
126+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG1"/>
127+
<magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4_2"/>
128+
<!-- Verify image on TinyMCE4 -->
129+
<comment userInput="Verify data on TinyMCE4" stepKey="comment10"/>
130+
<reloadPage stepKey="reloadPage3"/>
131+
<waitForPageLoad stepKey="waitForPageToBeLoaded3"/>
132+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage4_2"/>
133+
<seeElement selector="{{TextOnStage.tinymce('1')}}{{CmsWYSIWYGSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSourceOnStage2"/>
134+
</test>
135+
</tests>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
5454
<argument name="contentType" value="PageBuilderTextContentType"/>
5555
</actionGroup>
56-
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCE3WidgetBtn}}" stepKey="waitForTinyMCE3"/>
56+
<comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/>
5757
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame1"/>
5858
<!-- Verify inputed text is carried out to slideout -->
5959
<comment userInput="Verify inputed text is carried out to slideout" stepKey="comment1"/>

0 commit comments

Comments
 (0)