Skip to content

Commit 3d0efbd

Browse files
MC-34590: Page builder editor breaks Cms pages with non Latin1 characters
1 parent fb11c36 commit 3d0efbd

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@
160160
<actualResult type="variable">getText</actualResult>
161161
</assertContains>
162162
</actionGroup>
163+
<actionGroup name="AddPageLinkWidgetToTinyMCEWithAnchorAndTitleActionGroup" extends="addPageLinkWidgetToTinyMCE">
164+
<arguments>
165+
<argument name="anchor" defaultValue="" type="string"/>
166+
<argument name="title" defaultValue="" type="string"/>
167+
</arguments>
168+
<comment userInput="Insert anchor and title text" stepKey="commentAddAnchorAndTitleText" after="waitForLoadingMaskToDisappear2"/>
169+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="waitForInputAnchorCustomText" after="commentAddAnchorAndTitleText"/>
170+
<fillField selector="{{WidgetSection.InputAnchorCustomText}}" userInput="{{anchor}}" stepKey="insertTextToDisplay" after="waitForInputAnchorCustomText" />
171+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="waitForInputAnchorCustomTitle" after="insertTextToDisplay"/>
172+
<fillField selector="{{WidgetSection.InputAnchorCustomTitle}}" userInput="{{title}}" stepKey="insertTitle" after="waitForInputAnchorCustomTitle"/>
173+
<waitForElementVisible selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1" after="waitForInsertWidgetModalToClose"/>
174+
<click selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
175+
</actionGroup>
163176
<actionGroup name="validateTextInTinyMCE">
164177
<arguments>
165178
<argument name="property" defaultValue=""/>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565
<data key="stageValue">{{widget type=&quot;Magento\Cms\Block\Widget\Page\Link&quot; template=&quot;widget/link/link_block.phtml&quot; page_id=</data>
6666
<data key="stageValueEncoded">e3t3aWRnZXQgdHlwZT0iTWFnZW50b1xDbXNcQmxvY2tcV2lkZ2V0XFBhZ2VcTGluayIgdGVtcGxhdGU9IndpZGdldC9saW5rL2xpbmtfYmxvY2sucGh0bWwiIHBhZ2VfaWQ9</data>
6767
</entity>
68+
<entity name="TinyMCEWidgetCMSPageLinkWithAnchorAndTitle" type="pagebuilder_text_widget_property" extends="TinyMCEWidgetCMSPageLink">
69+
<data key="anchorText">Piiramatult kõnesid ja SMSe Eestis ja ELi rändluses</data>
70+
<data key="title">Piiramatult kõnesid ja SMSe Eestis ja ELi rändluses</data>
71+
</entity>
6872
<entity name="PageBuilderTextArea_WidgetCMSPageLink" type="pagebuilder_text_widget_property">
6973
<data key="widgetType">Magento\Cms\Block\Widget\Page\Link</data>
7074
<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.xml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,10 @@
745745
<argument name="contentType" value="PageBuilderTextContentType"/>
746746
</actionGroup>
747747
<clickWithLeftButton x="10" y="10" selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
748-
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
749-
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
748+
<actionGroup ref="AddPageLinkWidgetToTinyMCEWithAnchorAndTitleActionGroup" stepKey="addPageLinkWidgetToTinyMCE">
750749
<argument name="page" value="$$createCMSPageB.identifier$$"/>
750+
<argument name="anchor" value="{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.anchorText}}"/>
751+
<argument name="title" value="{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.title}}"/>
751752
</actionGroup>
752753
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetStage1"/>
753754
<!--Verify widget edit page-->
@@ -778,6 +779,19 @@
778779
<actionGroup ref="doubleClickWidgetTinyMCE" stepKey="doubleClickWidget">
779780
<argument name="widget" value="TinyMCEWidgetCMSPageLink.editPanelValue"/>
780781
</actionGroup>
782+
<!-- Grab a value from the link-->
783+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="waitForInputAnchorCustomText"/>
784+
<grabValueFrom selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="grabAnchorText"/>
785+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="waitForInputAnchorCustomTitle"/>
786+
<grabValueFrom selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="grabTitleText"/>
787+
<assertEquals stepKey="assertAnchorTextCMSWidgetLink" message="pass">
788+
<expectedResult type="string">{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.anchorText}}</expectedResult>
789+
<actualResult type="string">{$grabAnchorText}</actualResult>
790+
</assertEquals>
791+
<assertEquals stepKey="assertTitleCMSWidgetLink" message="pass">
792+
<expectedResult type="string">{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.title}}</expectedResult>
793+
<actualResult type="string">{$grabTitleText}</actualResult>
794+
</assertEquals>
781795
<actionGroup ref="closeWidgetPanelTinyMCE" stepKey="closeWidgetPanelTinyMCE"/>
782796
<!-- Validate Storefront -->
783797
<comment userInput="Verify Widget Content Type on storefront" stepKey="commentVerifyWidgetOnStorefront"/>

0 commit comments

Comments
 (0)