Skip to content

Commit 7caf86f

Browse files
committed
PB-170: TinyMCE Performance is very poor with multiple instances on Stage
- Create selection test
1 parent a81e6b1 commit 7caf86f

File tree

9 files changed

+58
-11
lines changed

9 files changed

+58
-11
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Data/TextData.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,17 @@
124124
<data key="endY">15</data>
125125
<data key="selection">his is a h</data>
126126
</entity>
127+
<entity name="TinyMCEPartialTextSelection" type="pagebuilder_text_selection">
128+
<data key="startX">18</data>
129+
<data key="endX">55</data>
130+
<data key="startY">15</data>
131+
<data key="endY">15</data>
132+
<data key="selection">t strin</data>
133+
</entity>
134+
<entity name="TinyMCEHeadingVariableTextSelection" type="pagebuilder_multiple_text_selection">
135+
<data key="selection">his is a heading
136+
Base URL
137+
138+
test strin</data>
139+
</entity>
127140
</entities>

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

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,7 +3013,7 @@
30133013
<severity value="MAJOR"/>
30143014
<useCaseId value=""/>
30153015
<testCaseId value=""/>
3016-
<!-- <group value="pagebuilder"/>-->
3016+
<group value="pagebuilder"/>
30173017
<group value="pagebuilder-text"/>
30183018
</annotations>
30193019
<before>
@@ -3066,12 +3066,53 @@
30663066
->moveToElement($heading, {{TinyMCEPartialHeadingSelection.endX}}, {{TinyMCEPartialHeadingSelection.endY}})
30673067
->release()
30683068
->perform();
3069-
}" stepKey="selectTextInTinyMCE"/>
3069+
}" stepKey="selectHeadingTextInTinyMCE"/>
30703070
<waitForElementVisible selector="{{TextOnStage.tinymceInFocus('1')}}" stepKey="waitForTinyMCEFocus"/>
3071-
<executeJS function="return window.getSelection().toString()" stepKey="selectionString"/>
3071+
<executeJS function="return window.getSelection().toString()" stepKey="selectionHeadingString"/>
30723072
<assertEquals stepKey="assertSelectionText">
30733073
<expectedResult type="string">{{TinyMCEPartialHeadingSelection.selection}}</expectedResult>
3074-
<actualResult type="variable">selectionString</actualResult>
3074+
<actualResult type="variable">selectionHeadingString</actualResult>
3075+
</assertEquals>
3076+
<reloadPage stepKey="reloadPage" />
3077+
<waitForPageLoad stepKey="waitForReload" />
3078+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
3079+
<scrollTo selector="{{TextOnStage.tinymce('1')}}" stepKey="scrollToTinyMCE2"/>
3080+
<!-- Select portion of paragraph text "es stri" -->
3081+
<executeInSelenium function="function ($webdriver) use ($I) {
3082+
$text = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//div[contains(@class, \'inline-wysiwyg\')]//p[2]'));
3083+
$actions = new \Facebook\WebDriver\Interactions\WebDriverActions($webdriver);
3084+
$actions->moveToElement($text, {{TinyMCEPartialTextSelection.startX}}, {{TinyMCEPartialTextSelection.startY}})
3085+
->clickAndHold()
3086+
->moveToElement($text, {{TinyMCEPartialTextSelection.endX}}, {{TinyMCEPartialTextSelection.endY}})
3087+
->release()
3088+
->perform();
3089+
}" stepKey="selectTextInTinyMCE"/>
3090+
<waitForElementVisible selector="{{TextOnStage.tinymceInFocus('1')}}" stepKey="waitForTinyMCEFocus2"/>
3091+
<executeJS function="return window.getSelection().toString()" stepKey="selectionTextString"/>
3092+
<assertEquals stepKey="assertSelectionText2">
3093+
<expectedResult type="string">{{TinyMCEPartialTextSelection.selection}}</expectedResult>
3094+
<actualResult type="variable">selectionTextString</actualResult>
3095+
</assertEquals>
3096+
<reloadPage stepKey="reloadPage2" />
3097+
<waitForPageLoad stepKey="waitForReload2" />
3098+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage3"/>
3099+
<scrollTo selector="{{TextOnStage.tinymce('1')}}" stepKey="scrollToTinyMCE3"/>
3100+
<!-- Select from part of the heading, over the variable, to part of the text string -->
3101+
<executeInSelenium function="function ($webdriver) use ($I) {
3102+
$heading = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//div[contains(@class, \'inline-wysiwyg\')]//h2'));
3103+
$text = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//div[contains(@class, \'inline-wysiwyg\')]//p[2]'));
3104+
$actions = new \Facebook\WebDriver\Interactions\WebDriverActions($webdriver);
3105+
$actions->moveToElement($heading, {{TinyMCEPartialHeadingSelection.startX}}, {{TinyMCEPartialHeadingSelection.startY}})
3106+
->clickAndHold()
3107+
->moveToElement($text, {{TinyMCEPartialTextSelection.endX}}, {{TinyMCEPartialTextSelection.endY}})
3108+
->release()
3109+
->perform();
3110+
}" stepKey="selectHeadingTextAndVariableTinyMCE"/>
3111+
<waitForElementVisible selector="{{TextOnStage.tinymceInFocus('1')}}" stepKey="waitForTinyMCEFocus3"/>
3112+
<executeJS function="return window.getSelection().toString()" stepKey="selectionMultipleString"/>
3113+
<assertEquals stepKey="assertSelectionText3">
3114+
<expectedResult type="string">{{TinyMCEHeadingVariableTextSelection.selection}}</expectedResult>
3115+
<actualResult type="variable">selectionMultipleString</actualResult>
30753116
</assertEquals>
30763117
</test>
30773118
</tests>

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/banner/preview.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/slide/preview.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/text/preview.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/converter/html/directive.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/page-builder.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/stage.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/utils/editor.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)