Skip to content

Commit 0cb45f9

Browse files
MC-34620: Page builder editor breaks Cms pages with non Latin1 characters
1 parent 65a96d1 commit 0cb45f9

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AddPageLinkWidgetToTinyMCEWithAnchorAndTitleActionGroup" extends="addPageLinkWidgetToTinyMCE">
11+
<arguments>
12+
<argument name="page" defaultValue="" type="string"/>
13+
<argument name="anchor" defaultValue="" type="string"/>
14+
<argument name="title" defaultValue="" type="string"/>
15+
</arguments>
16+
<comment userInput="Insert anchor and title text" stepKey="commentAddAnchorAndTitleText" after="waitForLoadingMaskToDisappear2"/>
17+
<fillField selector="{{WidgetSection.InputAnchorCustomText}}" userInput="{{anchor}}" stepKey="insertTextToDisplay" after="commentAddAnchorAndTitleText" />
18+
<fillField selector="{{WidgetSection.InputAnchorCustomTitle}}" userInput="{{title}}" stepKey="insertTitle" after="insertTextToDisplay"/>
19+
<waitForElementVisible selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1" after="waitForInsertWidgetModalToClose"/>
20+
<click selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="stageValue">{{widget type=&quot;Magento\Cms\Block\Widget\Page\Link&quot; template=&quot;widget/link/link_block.phtml&quot; page_id=</data>
4040
<data key="stageValueEncoded">e3t3aWRnZXQgdHlwZT0iTWFnZW50b1xDbXNcQmxvY2tcV2lkZ2V0XFBhZ2VcTGluayIgdGVtcGxhdGU9IndpZGdldC9saW5rL2xpbmtfYmxvY2sucGh0bWwiIHBhZ2VfaWQ9</data>
4141
</entity>
42+
<entity name="TinyMCEWidgetCMSPageLinkWithAnchorAndTitle" extends="TinyMCEWidgetCMSPageLink" type="pagebuilder_text_widget_property">
43+
<data key="anchorText">Piiramatult kõnesid ja SMSe Eestis ja ELi rändluses</data>
44+
<data key="title">Piiramatult kõnesid ja SMSe Eestis ja ELi rändluses</data>
45+
</entity>
4246
<entity name="PageBuilderTextArea_WidgetCMSPageLink" type="pagebuilder_text_widget_property">
4347
<data key="widgetType">Magento\Cms\Block\Widget\Page\Link</data>
4448
<data key="editPanelValue">{{widget type=&quot;Magento\\Cms\\Block\\Widget\\Page\\Link&quot; template=&quot;widget/link/link_block.phtml&quot; page_id=</data>

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
<argument name="contentType" value="PageBuilderTextContentType"/>
4141
</actionGroup>
4242
<clickWithLeftButton x="10" y="10" selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
43-
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
44-
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
43+
<actionGroup ref="AddPageLinkWidgetToTinyMCEWithAnchorAndTitleActionGroup" stepKey="addPageLinkWidgetToTinyMCE">
44+
<argument name="widget" value="TinyMCEWidgetCMSPageLinkWithAnchorAndTitle"/>
4545
<argument name="page" value="$$createCMSPageB.identifier$$"/>
46+
<argument name="anchor" value="{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.anchorText}}"/>
47+
<argument name="title" value="{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.title}}"/>
4648
</actionGroup>
4749
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetStage1"/>
4850
<!--Verify widget edit page-->
@@ -73,6 +75,17 @@
7375
<actionGroup ref="doubleClickWidgetTinyMCE" stepKey="doubleClickWidget">
7476
<argument name="widget" value="TinyMCEWidgetCMSPageLink.editPanelValue"/>
7577
</actionGroup>
78+
<!-- Grab a value from the link-->
79+
<grabValueFrom selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="grabAnchorText"/>
80+
<grabValueFrom selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="grabTitleText"/>
81+
<assertEquals stepKey="assertAnchorTextCMSWidgetLink" message="pass">
82+
<expectedResult type="string">{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.anchorText}}</expectedResult>
83+
<actualResult type="string">{$grabAnchorText}</actualResult>
84+
</assertEquals>
85+
<assertEquals stepKey="assertTitleCMSWidgetLink" message="pass">
86+
<expectedResult type="string">{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.title}}</expectedResult>
87+
<actualResult type="string">{$grabTitleText}</actualResult>
88+
</assertEquals>
7689
<actionGroup ref="closeWidgetPanelTinyMCE" stepKey="closeWidgetPanelTinyMCE"/>
7790
<!-- Validate Storefront -->
7891
<comment userInput="Verify Widget Content Type on storefront" stepKey="commentVerifyWidgetOnStorefront"/>

0 commit comments

Comments
 (0)