Skip to content

Commit 30475f9

Browse files
committed
MC-13769: Add Missing P0-P1 MFTF Tests For PageBuilder On CMS Block - Render Content Through Block
- Fixing text tests rendered through block - Updating/Adding supporting data, sections, actiongroups
1 parent 7b1ab21 commit 30475f9

File tree

6 files changed

+180
-282
lines changed

6 files changed

+180
-282
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,23 @@
1414
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="clickOutsideLiveEdit"/>
1515
<waitForPageLoad stepKey="waitForAnimation"/>
1616
</actionGroup>
17+
<actionGroup name="focusOnTextInlineTinyMCEEditor">
18+
<arguments>
19+
<argument name="index" defaultValue="1" type="string"/>
20+
</arguments>
21+
<comment userInput="focusOnTextInlineTinyMCEEditor" stepKey="comment"/>
22+
<waitForElementVisible selector="{{TextOnStage.tinymce(index)}}" stepKey="waitForEditor"/>
23+
<click selector="{{TextOnStage.tinymce(index)}}" stepKey="clickEditor"/>
24+
<waitForPageLoad stepKey="waitForEditorToBeFocused"/>
25+
<waitForElementVisible selector="{{TextOnStage.tinymceInFocus(index)}}" stepKey="waitForEditorFocused"/>
26+
</actionGroup>
27+
<actionGroup name="focusOnTextInlineTextArea">
28+
<arguments>
29+
<argument name="index" defaultValue="1" type="string"/>
30+
</arguments>
31+
<comment userInput="focusOnTextInlineTextArea" stepKey="comment"/>
32+
<waitForElementVisible selector="{{TextOnStage.textArea(index)}}" stepKey="waitForEditor"/>
33+
<click selector="{{TextOnStage.textArea(index)}}" stepKey="clickEditor"/>
34+
<waitForPageLoad stepKey="waitForEditorToBeFocused"/>
35+
</actionGroup>
1736
</actionGroups>

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

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@
2222
<waitForElementVisible selector="{{section.textInIFrame(property.value)}}" stepKey="waitForTextVisible"/>
2323
<switchToIFrame stepKey="exitIFrame"/>
2424
</actionGroup>
25+
<actionGroup name="addTextToTinyMCEInline">
26+
<arguments>
27+
<argument name="section"/>
28+
<argument name="text" defaultValue="{{PageBuilderTextProperty.value}}" type="string"/>
29+
<argument name="index" defaultValue="1" type="string"/>
30+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
31+
</arguments>
32+
<comment userInput="addTextToTinyMCEInline" stepKey="comment"/>
33+
<waitForElementVisible selector="{{section.tinymceInFocus(index)}}" stepKey="waitForEditorFocused"/>
34+
<pressKey selector="{{section.tinymce(index)}}" userInput="{{text}}" stepKey="enterText"/>
35+
<waitForPageLoad stepKey="waitForTextEdit"/>
36+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="loseFocusFromEditor"/>
37+
<waitForPageLoad stepKey="waitForUnFocus"/>
38+
</actionGroup>
39+
<actionGroup name="addTextToTinyMCEInlineWYSIWYGDisabled" extends="addTextToTinyMCEInline">
40+
<comment userInput="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="comment"/>
41+
<waitForElementVisible selector="{{section.textArea(index)}}" stepKey="waitForEditorFocused"/>
42+
<pressKey selector="{{section.textArea(index)}}" userInput="{{text}}" stepKey="enterText"/>
43+
<waitForPageLoad stepKey="waitForTextEdit"/>
44+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="loseFocusFromEditor"/>
45+
<waitForPageLoad stepKey="waitForUnFocus"/>
46+
</actionGroup>
2547
<actionGroup name="replaceTextToTinyMCE" extends="addTextToTinyMCE">
2648
<executeJS function="tinymce.activeEditor.setContent('{{property.value}}')" stepKey="addTextToWYSIWYG"/>
2749
</actionGroup>
@@ -159,10 +181,24 @@
159181
<argument name="selector" type="string"/>
160182
<argument name="value" type="string"/>
161183
</arguments>
162-
<executeJS function="return Boolean(document.evaluate(&quot;{{selector}}&quot;, document.body).iterateNext().value.match(&apos;{{value}}&apos;))" stepKey="textareaValue"/>
163-
<assertEquals stepKey="assertTextareaContainsValue">
164-
<expectedResult type="bool">true</expectedResult>
184+
<executeJS function="return document.evaluate(&quot;{{selector}}&quot;, document.body).iterateNext().value" stepKey="textareaValue"/>
185+
<assertContains stepKey="assertTextareaContainsValue">
186+
<expectedResult type="string">{{value}}</expectedResult>
165187
<actualResult type="variable">textareaValue</actualResult>
166-
</assertEquals>
188+
</assertContains>
189+
</actionGroup>
190+
<actionGroup name="clickInsertImageInTinyMCE">
191+
<!-- This goes in CE repo -->
192+
<comment userInput="clickInsertImageInTinyMCE" stepKey="comment"/>
193+
<waitForElementVisible selector="{{TinyMCESection.InsertImageIcon}}" stepKey="waitForInsertImageIcon"/>
194+
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon"/>
195+
<waitForPageLoad stepKey="waitForPageLoad" />
196+
<waitForElementVisible selector="{{MediaGallerySection.Browse}}" stepKey="waitForBrowseImagesButton"/>
197+
</actionGroup>
198+
<actionGroup name="clickMediaGalleryStorageRootArrow">
199+
<!-- This goes in CE repo -->
200+
<click selector="{{MediaGallerySection.StorageRootArrow}}" stepKey="clickStorageRootArrow"/>
201+
<waitForPageLoad stepKey="waitForPageLoad2"/>
202+
<waitForElement selector="{{MediaGallerySection.StorageRootArrowClicked}}" stepKey="waitForStorageRootArrowClicked"/>
167203
</actionGroup>
168204
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<data key="section">General</data>
2222
<data key="fieldName">text</data>
2323
<data key="cmsPageLinkName" unique="suffix">cms-page-link-</data>
24-
<data key="value"></data>
24+
<data key="value"/>
2525
</entity>
2626
<entity name="PageBuilderTextContentTypeEmpty" type="pagebuilder_text_property">
2727
<data key="name">Text</data>
@@ -65,5 +65,6 @@
6565
<entity name="PageBuilderTextArea_WidgetCMSHomepageLink" type="pagebuilder_text_widget_property">
6666
<data key="widgetType">Magento\Cms\Block\Widget\Page\Link</data>
6767
<data key="editPanelValue">{{widget type="Magento\Cms\Block\Widget\Page\Link" template="widget/link/link_block.phtml" page_id="2" type_name="CMS Page Link"}}</data>
68+
<data key="identifier">home</data>
6869
</entity>
6970
</entities>

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="tinymceInFocus" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg}}]//div[contains(@class, 'inline-wysiwyg') and contains(@class, 'mce-edit-focus')]" 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/Section/PageBuilderWYSIWYGSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@
4242
<element name="imageSelectorBrowse" type="button" selector="div[aria-label='Insert/edit image'] i.mce-i-browse"/>
4343
<element name="imageSelectorOk" type="button" selector="//div[contains(@aria-label, 'Insert/edit image')]//span[contains(@class, 'mce-txt')][text()='Ok']"/>
4444
</section>
45+
<section name="MediaGallerySection">
46+
<!-- This goes in CE repo -->
47+
<element name="StorageRootArrowClicked" type="button" selector="#root > a.jstree-clicked"/>
48+
</section>
4549
</sections>

0 commit comments

Comments
 (0)