Skip to content

Commit 2ab1c0d

Browse files
committed
MC-3812: Text/Banner - Stage Inline Editor becomes focused and editable after clicking Save button on Edit Form
- Include test to verify state of TinyMCE after saving edit form
1 parent e04033e commit 2ab1c0d

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<element name="textareaPlaceholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//textarea[contains(@class, 'inline-wysiwyg-textarea') and contains(@placeholder,'Edit Text')]" parameterized="true"/>
2424
<element name="textPlaceholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg}}]//*[contains(@class, 'placeholder-text') and text()='Edit Text']" parameterized="true"/>
2525
<element name="tinymce" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg}}]//div[contains(@class, 'inline-wysiwyg')]" parameterized="true"/>
26+
<element name="tinymceFocused" type="text" selector="(//div[contains(@class, 'pagebuilder-text') and contains(@class, 'pagebuilder-toolbar-active')])[{{arg}}]" parameterized="true"/>
2627
<element name="importantStyle" type="text" selector="//span[text()='Important']"/>
2728
<element name="textInImportantStyle" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//div[contains(normalize-space(@class), 'cms-content-important') and text()='{{arg2}}']" parameterized="true"/>
2829
<element name="emptyTextInImportantStyle" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//div[contains(normalize-space(@class), 'cms-content-important')]" parameterized="true"/>

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,4 +2569,50 @@
25692569
<!-- Validate Image Editor On Storefront -->
25702570
<seeElement selector="{{TextOnStorefront.messageContentTextAreaImage('1', PageBuilderBackgroundImage_JPG.value)}}" stepKey="validateImageFrontEnd"/>
25712571
</test>
2572+
<test name="InlineTinyMceEditingIsNotFocusedOnEditSave">
2573+
<annotations>
2574+
<features value="PageBuilder"/>
2575+
<stories value="Text"/>
2576+
<title value="TinyMCE should not be incorrectly focused"/>
2577+
<description value="Verify the inline editing mode for TinyMCE isn't focused automatically when saving content within the edit panel"/>
2578+
<severity value="MAJOR"/>
2579+
<useCaseId value="MC-3812"/>
2580+
<testCaseId value="MC-5728"/>
2581+
<group value="pagebuilder"/>
2582+
<group value="pagebuilder-text"/>
2583+
</annotations>
2584+
<before>
2585+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
2586+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2587+
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" />
2588+
</before>
2589+
<after>
2590+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
2591+
<actionGroup ref="logout" stepKey="logout"/>
2592+
</after>
2593+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1">
2594+
<argument name="CMSPage" value="$$createCMSPage$$"/>
2595+
</actionGroup>
2596+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup1">
2597+
<argument name="group" value="PageBuilderTextContentType"/>
2598+
</actionGroup>
2599+
<actionGroup ref="dragContentTypeToStage" stepKey="dragTextOntoStage">
2600+
<argument name="contentType" value="PageBuilderTextContentType"/>
2601+
</actionGroup>
2602+
<!-- Drag text into stage -->
2603+
<comment userInput="Drag text into stage" stepKey="commentDragTextIntoStage"/>
2604+
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea"/>
2605+
<seeElement selector="{{TextOnStage.tinymceFocused('1')}}" stepKey="seeFocusedTinyMce"/>
2606+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="lostFocusFromWYSIWYG1"/>
2607+
<dontSeeElement selector="{{TextOnStage.tinymceFocused('1')}}" stepKey="dontSeeFocusedTinyMce"/>
2608+
<!-- Open and save slide out panel -->
2609+
<comment userInput="Open and save slide out panel" stepKey="commentOpenAndSaveSlideOut"/>
2610+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
2611+
<argument name="contentType" value="PageBuilderTextContentType"/>
2612+
</actionGroup>
2613+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
2614+
<!-- Verify TinyMCE is not automatically focused -->
2615+
<comment userInput="Verify TinyMCE is not automatically focused" stepKey="commentVerifyNotFocused"/>
2616+
<dontSeeElement selector="{{TextOnStage.tinymceFocused('1')}}" stepKey="dontSeeTinyMceFocused"/>
2617+
</test>
25722618
</tests>

0 commit comments

Comments
 (0)