Skip to content

Commit 69a1c5c

Browse files
committed
#419: Nested Links If User Adds Link Attribute & Link Widget to Banner/Slide, mftf refactoring.
1 parent d3ba14d commit 69a1c5c

File tree

4 files changed

+42
-44
lines changed

4 files changed

+42
-44
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
<annotations>
1212
<description>Clicks the Insert Link button from the TinyMCE.</description>
1313
</annotations>
14-
<waitForElementVisible selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{TinyMCESection.InsertLink}}" stepKey="waitForTinyMCEInsertLinkButton">
15-
<click selector="{{WYSIWYGOnPageBuilderInline.notCss}} {{TinyMCESection.InsertLink}}" stepKey="clickTinyMCEInsertLinkButton"/>
14+
<arguments>
15+
<argument name="section" defaultValue="TinyMCESection"/>
16+
<argument name="wysiwygArea" defaultValue="{{WYSIWYGOnPageBuilderInline.notCss}}" type="string"/>
17+
</arguments>
18+
<waitForElementVisible selector="{{wysiwygArea}} {{section.InsertLink}}" stepKey="waitForTinyMCEInsertLinkButton"/>
19+
<click selector="{{wysiwygArea}} {{section.InsertLink}}" stepKey="clickTinyMCEInsertLinkButton"/>
1620
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForWYSIWYGInsertLinkModal"/>
1721
</actionGroup>
18-
</actionGroups>
22+
</actionGroups>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
<arguments>
1515
<argument name="textToDisplay" defaultValue="" type="string"/>
1616
</arguments>
17-
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.textToDisplayInput)}}" stepKey="waitForTinyMCELinkModalTextToDisplayInput"/>
17+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" stepKey="waitForTinyMCELinkModalTextToDisplayInput"/>
1818
<fillField selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" userInput="{{textToDisplay}}" stepKey="insertTinyMCELinkModalTextToDisplayInput"/>
19-
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.okButton)}}" stepKey="waitForTinyMCEInsertLinkModalOkButton"/>
19+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="waitForTinyMCEInsertLinkModalOkButton"/>
2020
<click selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="clickTinyMCEInsertLinkModalOkButton"/>
2121
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForTinyMCEInsertLinkModalNotVisible"/>
2222
</actionGroup>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderBannerCommonTest/BannerCannotHaveInlineWysiwygWidgetAndLinkUrlTest.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@
142142
</actionGroup>
143143
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
144144
<!-- Check inline WYSIWYG editor will validate for not allowing Widget and Link URL at the same time -->
145-
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorArea"/>
145+
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorArea">
146+
<argument name="section" value="BannerOnBackend"/>
147+
</actionGroup>
146148
<!-- Add Widget to inline WYSIWYG editor on Stage -->
147149
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToInlineWYSIWYG">
148150
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
@@ -157,7 +159,9 @@
157159
<actualResult type="variable">grabIfWidgetInWysiwygBoolean</actualResult>
158160
</assertFalse>
159161
<!-- Check inline WYSIWYG editor will validate for not allowing Link and Link URL at the same time -->
160-
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorAreaAddLink"/>
162+
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorAreaAddLink" >
163+
<argument name="section" value="BannerOnBackend"/>
164+
</actionGroup>
161165
<!-- Add Link to inline WYSIWYG editor on Stage -->
162166
<actionGroup ref="insertLinkInWYSIWYG" stepKey="insertLinkInStageInlineWYSIWYG">
163167
<argument name="url" value="{{ExternalLink.googleUrl}}"/>
@@ -173,26 +177,22 @@
173177
<actualResult type="variable">grabIfLinkInWysiwygBoolean</actualResult>
174178
</assertFalse>
175179
<!-- Check inline WYSIWYG editor will validate for not allowing Image Link and Link URL at the same time -->
176-
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorAreaAddImageLink"/>
177-
<!-- Add Image Link to inline WYSIWYG -->
178-
179-
<!-- TD mew AG like clickTinyMCEInsertImageButtonActionGroup -->
180-
<click selector="{{WYSIWYGOnPageBuilderInline.inlineCss}} {{TinyMCESection.InsertLink}}" stepKey="clickWYSIWYGInsertLinkButton"/>
181-
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForInlineWYSIWYGInsertLinkModal"/>
182-
<click selector="{{WYSIWYGInsertLinkModal.browseMediaGalleryButton}}" stepKey="clickInlineWYSIWYGImageSelectorBrowseButton"/>
183-
<waitForPageLoad stepKey="waitForInlineWYSIWYGImageSelectorBrowseModal"/>
184-
185-
<actionGroup ref="clickMediaGalleryStorageRootArrow" stepKey="clickInlineWYSIWYGSelectorBrowseModalMediaGalleryStorageRootArrow"/>
186-
<actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToInlineWYSIWYGSelectorBrowseModalStorageRootImageFolder">
187-
<argument name="FolderName" value="{{ImageFolder.name}}"/>
188-
</actionGroup>
189-
<actionGroup ref="AttachImageActionGroup" stepKey="selectImageFromInlineWYSIWYGSelectorBrowseModalStorageRootImageFolder">
180+
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorAreaAddImageLink">
181+
<argument name="section" value="BannerOnBackend"/>
182+
</actionGroup>
183+
<!-- Add Image Link to TinyMCE -->
184+
<actionGroup ref="clickTinyMCEInsertImageButtonActionGroup" stepKey="clickInlineWYSIWYGTinyMCEInsertImageButton">
185+
<argument name="wysiwygArea" value="{{WYSIWYGOnPageBuilderInline.inlineCss}}"/>
186+
</actionGroup>
187+
<actionGroup ref="goToMediaGalleryFromTinyMCEImageModalActionGroup" stepKey="goToMediaGalleryFromInlineWYSIWYGTinyMCEImageModal"/>
188+
<actionGroup ref="clickMediaGalleryStorageRootArrow" stepKey="clickInlineWYSIWYGTinyMCESelectorBrowseModalMediaGalleryStorageRootArrow"/>
189+
<actionGroup ref="AttachImageActionGroup" stepKey="selectImageFromInlineWYSIWYGTinyMCESelectorBrowseModalStorageRootImageFolder">
190190
<argument name="Image" value="PageBuilderImageProperty_StageJPG"/>
191191
</actionGroup>
192-
<actionGroup ref="SaveImageActionGroup" stepKey="saveInlineWYSIWYGSelectorBrowseModalStorageRootImageFolderImage"/>
193-
<fillField selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" userInput="{{PageBuilderBannerLinkUrlProperty.value}}" stepKey="insertInlineWYSIWYGLinkModalTextToDisplay"/>
194-
<click selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="clickInlineWYSIWYGLinkModalOkButton"/>
195-
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForInlineWYSIWYGInsertLinkModalGone"/>
192+
<actionGroup ref="SaveImageActionGroup" stepKey="saveInlineWYSIWYGTinyMCESelectorBrowseModalStorageRootImageFolderImage"/>
193+
<actionGroup ref="fillTinyMCEInsertImageModalAndSaveActionGroup" stepKey="fillInlineWYSIWYGTinyMCEInsertImageModalAndSave">
194+
<argument name="textToDisplay" value="{{PageBuilderBannerLinkUrlProperty.value}}"/>
195+
</actionGroup>
196196
<waitForPageLoad stepKey="waitForInlineWYSIWYGStorageRoot"/>
197197
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unfocusOnInlineWYSIWYGEditorAreaAddImageLink"/>
198198
<waitForElementVisible selector="{{PageBuilderStage.modal(PageBuilderBannerMessageInvalidProperty.stageErrorMessage)}}" stepKey="waitForNestingImageLinkCorrectErrorModal"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderSlideItemCommonTest/SlideItemCannotHaveInlineWysiwygWidgetAndLinkUrlTest.xml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
</actionGroup>
3636
<!-- Check invalid Link Url and Message Text Widget -->
3737
<!-- Add Widget to TinyMCE -->
38-
<!-- ? -->
3938
<actionGroup ref="saveEditPanelAndValidateFieldError" stepKey="validateInvalidMessageWithWidget">
4039
<argument name="property" value="PageBuilderSlideItemMessageInvalidWidgetProperty"/>
4140
</actionGroup>
@@ -49,7 +48,6 @@
4948
</actionGroup>
5049
<!-- Check invalid Link Url and Message Text Link -->
5150
<!-- Add Link to TinyMCE -->
52-
<!-- ? -->
5351
<actionGroup ref="saveEditPanelAndValidateFieldError" stepKey="validateInvalidMessageWithLink">
5452
<argument name="property" value="PageBuilderSlideItemMessageInvalidProperty"/>
5553
</actionGroup>
@@ -63,9 +61,9 @@
6361
</actionGroup>
6462
<!-- Check invalid Link Url and Message Text Image Link -->
6563
<!-- Add Image Link to TinyMCE -->
66-
<fillField selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" userInput="{{PageBuilderSlideItemLinkURL_External.value}}" stepKey="insertTinyMCELinkModalTextToDisplay"/>
67-
<click selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="clickTinyMCELinkModalOkButton"/>
68-
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForTinyMCEInsertLinkModalGone"/>
64+
<actionGroup ref="fillTinyMCEInsertImageModalAndSaveActionGroup" stepKey="fillTinyMCEInsertImageModalAndSave">
65+
<argument name="textToDisplay" value="{{PageBuilderSlideItemLinkURL_External.value}}"/>
66+
</actionGroup>
6967
<actionGroup ref="saveEditPanelAndValidateFieldError" stepKey="validateInvalidMessageWithImageLink">
7068
<argument name="property" value="PageBuilderSlideItemMessageInvalidProperty"/>
7169
</actionGroup>
@@ -90,7 +88,6 @@
9088
<argument name="selection" value="{{ExternalLink.url}}"/>
9189
<argument name="newTab" value="PageBuilderSlideItemLinkNewTab_False"/>
9290
</actionGroup>
93-
<!-- ? -->
9491
<actionGroup ref="saveEditPanelAndValidateFieldError" stepKey="validateInvalidMessageWithWidgetAfterFillOutLinkUrl">
9592
<argument name="property" value="PageBuilderSlideItemMessageInvalidWidgetProperty"/>
9693
</actionGroup>
@@ -103,27 +100,24 @@
103100
<argument name="section" value="SlideOnConfigurationPanel"/>
104101
</actionGroup>
105102
<!-- Check inline WYSIWYG editor will validate for not allowing Widget and Link URL at the same time -->
106-
<click selector="{{PageBuilderStage.inlineWYSIWYGEditor(PageBuilderSlideContentType.role, '1')}}" stepKey="focusOnInlineWYSIWYGEditorArea"/>
107-
<!-- ? -->
108-
<waitForElementVisible selector="{{PageBuilderStage.inlineWYSIWYGEditorPanel(PageBuilderSlideContentType.role, '1')}}" stepKey="waitForInlineWYSIWYGEditorPanel"/>
109-
<!-- Add Widget to inline WYSIWYG editor on Stage -->
110-
<!-- ? -->
103+
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorArea">
104+
<argument name="section" value="SlideOnBackend"/>
105+
</actionGroup>
106+
<!-- Add Widget to inline WYSIWYG editor on Stage -->
111107
<waitForElementVisible selector="{{PageBuilderStage.modal(PageBuilderSlideItemMessageInvalidProperty.stageErrorMessage)}}" stepKey="waitForNestingWidgetCorrectErrorModal"/>
112108
<!-- Checks for Widget (placeholder) within the WYSIWYG with regex -->
113109
<!-- Check inline WYSIWYG editor will validate for not allowing Link and Link URL at the same time -->
114-
<click selector="{{PageBuilderStage.inlineWYSIWYGEditor(PageBuilderSlideContentType.role, '1')}}" stepKey="focusOnInlineWYSIWYGEditorAreaAddLink"/>
115-
<!-- ? -->
116-
<waitForElementVisible selector="{{PageBuilderStage.inlineWYSIWYGEditorPanel(PageBuilderSlideContentType.role, '1')}}" stepKey="waitForInlineWYSIWYGEditorPanelAddLink"/>
110+
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorAreaAddLink" >
111+
<argument name="section" value="SlideOnBackend"/>
112+
</actionGroup>
117113
<!-- Add Link to inline WYSIWYG editor on Stage -->
118-
<!-- ? -->
119114
<waitForElementVisible selector="{{PageBuilderStage.modal(PageBuilderSlideItemMessageInvalidProperty.stageErrorMessage)}}" stepKey="waitForNestingLinkCorrectErrorModal"/>
120115
<!-- Checks for A tags within the WYSIWYG with regex -->
121116
<!-- Check inline WYSIWYG editor will validate for not allowing Image Link and Link URL at the same time -->
122-
<click selector="{{PageBuilderStage.inlineWYSIWYGEditor(PageBuilderSlideContentType.role, '1')}}" stepKey="focusOnInlineWYSIWYGEditorAreaAddImageLink"/>
123-
<!-- ? -->
124-
<waitForElementVisible selector="{{PageBuilderStage.inlineWYSIWYGEditorPanel(PageBuilderSlideContentType.role, '1')}}" stepKey="waitForInlineWYSIWYGEditorPanelAddImageLink"/>
117+
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineWYSIWYGEditorAreaAddImageLink">
118+
<argument name="section" value="SlideOnBackend"/>
119+
</actionGroup>
125120
<!-- Add Image Link to inline WYSIWYG -->
126-
<!-- ? -->
127121
<waitForElementVisible selector="{{PageBuilderStage.modal(PageBuilderSlideItemMessageInvalidProperty.stageErrorMessage)}}" stepKey="waitForNestingImageLinkCorrectErrorModal"/>
128122
<!-- Checks for A tags within the TinyMCE with regex -->
129123
<!-- Checks for Widget Block within the message with regex -->

0 commit comments

Comments
 (0)