Skip to content

Commit c0a459f

Browse files
Merge remote-tracking branch 'owls/MC-521-editing-wysiwyg-banner' into cms-team-2-sprint-15
2 parents 9bea7da + 72e33b9 commit c0a459f

32 files changed

+984
-244
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,31 +122,25 @@
122122
<actionGroup name="validateBackgroundImage">
123123
<arguments>
124124
<argument name="section"/>
125-
<argument name="pageNamePrefix" defaultValue="admin" type="string"/>
126125
<argument name="backgroundImage"/>
127126
<argument name="index" defaultValue="1" type="string"/>
128127
</arguments>
129128
<comment userInput="validateBackgroundImage" stepKey="comment"/>
130129
<waitForElementVisible selector="{{section.base(index)}}" stepKey="waitForBaseElement"/>
131130
<waitForElementVisible selector="{{section.backgroundImage(index, backgroundImage.fileName)}}" stepKey="waitForBackgroundImage"/>
132131
<grabAttributeFrom selector="{{section.backgroundImage(index, backgroundImage.fileName)}}" userInput="style" stepKey="contentTypeStyle"/>
133-
<!-- Grab base URL -->
134-
<executeJS function="return '{{pageNamePrefix}}'" stepKey="pageNamePrefix"/>
135-
<grabFromCurrentUrl regex="/(^.+(?=\/$pageNamePrefix))/" stepKey="baseURL"/>
136132
<!-- Return the string value of background-image -->
137133
<executeJS function="return '{$contentTypeStyle}'.match(/((?&lt;=(background-image: url\((&quot;|\'))).+(?=(&quot;|\')\);))/)[0]" stepKey="backgroundImageValue"/>
138134
<!-- Convert all characters in string variables to regex friendly strings -->
139-
<executeJS function="return '{$baseURL}'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&amp;')" stepKey="regexBaseURL"/>
140135
<executeJS function="return '{{backgroundImage.path}}'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&amp;')" stepKey="regexFilePath"/>
141136
<assertRegExp stepKey="assertBackgroundImageContainsFileInformation">
142-
<expectedResult type="string">/{$regexBaseURL}\/pub\/media.*{$regexFilePath}\/{{backgroundImage.fileName}}(_\d+)?\.{{backgroundImage.extension}}/</expectedResult>
137+
<expectedResult type="string">/.*\/(pub\/|\/)?media.*{$regexFilePath}\/{{backgroundImage.fileName}}(_\d+)?\.{{backgroundImage.extension}}/</expectedResult>
143138
<actualResult type="variable">$backgroundImageValue</actualResult>
144139
</assertRegExp>
145140
</actionGroup>
146141
<actionGroup name="validateBackgroundMobileImage">
147142
<arguments>
148143
<argument name="section"/>
149-
<argument name="pageNamePrefix" type="string"/>
150144
<argument name="backgroundMobileImage"/>
151145
<argument name="index" defaultValue="1" type="string"/>
152146
</arguments>
@@ -155,16 +149,12 @@
155149
<waitForElement selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" stepKey="waitForBackgroundMobileImage"/>
156150
<dontSeeElement selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" stepKey="dontSeeBackgroundMobileImage"/>
157151
<grabAttributeFrom selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" userInput="style" stepKey="contentTypeStyle"/>
158-
<!-- Grab base URL -->
159-
<executeJS function="return '{{pageNamePrefix}}'" stepKey="pageNamePrefix"/>
160-
<grabFromCurrentUrl regex="/(^.+(?=\/$pageNamePrefix))/" stepKey="baseURL"/>
161152
<!-- Return the string value of background-image -->
162153
<executeJS function="return '{$contentTypeStyle}'.match(/((?&lt;=(background-image: url\((&quot;|\'))).+(?=(&quot;|\')\);))/)[0]" stepKey="backgroundMobileImageValue"/>
163154
<!-- Convert all characters in string variables to regex friendly strings -->
164-
<executeJS function="return '{$baseURL}'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&amp;')" stepKey="regexBaseURL"/>
165155
<executeJS function="return '{{backgroundMobileImage.path}}'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&amp;')" stepKey="regexFilePath"/>
166156
<assertRegExp stepKey="assertBackgroundMobileImageContainsFileInformation">
167-
<expectedResult type="string">/{$regexBaseURL}\/pub\/media.*{$regexFilePath}\/{{backgroundMobileImage.fileName}}(_\d+)?\.{{backgroundMobileImage.extension}}/</expectedResult>
157+
<expectedResult type="string">/.*\/(pub\/|\/)?media.*{$regexFilePath}\/{{backgroundMobileImage.fileName}}(_\d+)?\.{{backgroundMobileImage.extension}}/</expectedResult>
168158
<actualResult type="variable">$backgroundMobileImageValue</actualResult>
169159
</assertRegExp>
170160
<resizeWindow width="767" height="1000" stepKey="resizeWindowToMobile"/>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
<argument name="contentTypeIndex" defaultValue="1" type="string"/>
1515
<argument name="containerTargetType" defaultValue="PageBuilderColumnContentType"/>
1616
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
17+
<argument name="x" defaultValue="10" type="string"/>
18+
<argument name="y" defaultValue="0" type="string"/>
1719
</arguments>
1820
<waitForElementVisible time="20" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
19-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" x="10" y="0" stepKey="onMouseOverContentTypeStage"/>
21+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
2022
<waitForPageLoad time="30" stepKey="waitForMouseOverAnimation"/>
2123
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForOptions"/>
2224
<waitForElementVisible selector="{{ColumnOnBackend.columnMoveByIndex(contentTypeIndex)}}" stepKey="waitForMoveHandle"/>

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@
1717
<waitForElementVisible selector="{{ImageOnStage.imagePreview}}" stepKey="waitForImagePreview"/>
1818
<waitForElementVisible selector="{{ImageOnStage.imageSourceOnStage(property.fileName)}}" stepKey="waitForImageSource"/>
1919
</actionGroup>
20-
<actionGroup name="verifyUploadImageButtons">
21-
<arguments>
22-
<argument name="contentType"/>
23-
<argument name="section"/>
24-
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
25-
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
26-
</arguments>
27-
<comment userInput="Hover uploaded image to check Upload New Image button and Select From Gallery button" stepKey="commentHover"/>
28-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverBannerContentTypeStage"/>
29-
<waitForElementVisible selector="{{section.uploadNewImageBtn}}" stepKey="waitForUploadNewImageBtn" />
30-
<waitForElementVisible selector="{{section.selectFromGalleryImageBtn}}" stepKey="seeSelectFromGalleryBtn2" />
31-
</actionGroup>
3220
<actionGroup name="verifyImageOnSlideout">
3321
<arguments>
3422
<argument name="property"/>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="addTab">
12+
<arguments>
13+
<argument name="x" defaultValue="10" type="string"/>
14+
<argument name="y" defaultValue="0" type="string"/>
15+
</arguments>
1216
<click selector="{{TabsOnStage.tabsContainer}}" stepKey="focusOnContentType"/>
1317
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" stepKey="waitForContentTypeInStageVisible" />
14-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" x="10" y="0" stepKey="onMouseOverContentTypeStage"/>
18+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
1519
<waitForPageLoad stepKey="waitForMouseOverAnimation" />
1620
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderTabsContentType.role)}}" stepKey="waitForOptions" />
1721
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeAdd(PageBuilderTabsContentType.role)}}" stepKey="clickAddContentType"/>
@@ -21,10 +25,12 @@
2125
<arguments>
2226
<argument name="from" defaultValue="1" type="string"/>
2327
<argument name="to" defaultValue="2" type="string"/>
28+
<argument name="x" defaultValue="10" type="string"/>
29+
<argument name="y" defaultValue="0" type="string"/>
2430
</arguments>
2531
<click selector="{{TabsOnStage.tabsContainer}}" stepKey="focusOnContentType"/>
2632
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" stepKey="waitForContentTypeInStageVisible" />
27-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" x="10" y="0" stepKey="onMouseOverContentTypeStage"/>
33+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
2834
<waitForPageLoad stepKey="waitForMouseOverAnimation" time="30"/>
2935
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderTabsContentType.role)}}" stepKey="waitForOptions" />
3036
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeAdd(PageBuilderTabsContentType.role)}}" stepKey="clickAddContentType"/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<arguments>
4444
<argument name="contentType"/>
4545
<argument name="contentTypeIndex" defaultValue="1" type="string"/>
46-
<argument name="containerTargetType"/>
46+
<argument name="containerTargetType" defaultValue="PageBuilderRowContentType"/>
4747
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
4848
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
4949
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
@@ -103,7 +103,7 @@
103103
<arguments>
104104
<argument name="contentType"/>
105105
<argument name="contentTypeIndex" defaultValue="1" type="string"/>
106-
<argument name="containerTargetType"/>
106+
<argument name="containerTargetType" defaultValue="PageBuilderRowContentType"/>
107107
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
108108
<argument name="dropZoneIndex" defaultValue="1" type="string"/>
109109
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<argument name="offsetYCoordinate" defaultValue="0" type="string"/>
1616
</arguments>
1717
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" stepKey="waitForContentTypeInStageVisible"/>
18-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" x="10" y="0" stepKey="onMouseOverContentTypeStage"/>
18+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
1919
<waitForPageLoad stepKey="waitForPageLoad"/>
2020
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(contentType.role)}}" stepKey="waitForOptions"/>
2121
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeEdit(contentType.role)}}" stepKey="clickEditContentType"/>

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

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,33 @@
6060
<actionGroup name="goToMediaStorageFromStage">
6161
<arguments>
6262
<argument name="contentType"/>
63-
<argument name="section"/>
64-
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
65-
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
63+
<argument name="index" defaultValue="1" type="string"/>
64+
<argument name="x" defaultValue="null" type="string"/>
65+
<argument name="y" defaultValue="null" type="string"/>
6666
</arguments>
6767
<comment userInput="Hover over content type in stage and click Select From Gallery button" stepKey="commentHover"/>
68-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverImageContentTypeStage"/>
69-
<waitForElementVisible selector="{{section.selectFromGalleryImageBtn}}" stepKey="seeSelectFromGalleryBtn2" />
70-
<click selector="{{section.selectFromGalleryImageBtn}}" stepKey="clickSelectFromGalleryBtn1" />
68+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, index)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverImageContentTypeStage"/>
69+
<waitForElementVisible selector="{{PageBuilderStage.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="seeSelectFromGalleryBtn2" />
70+
<click selector="{{PageBuilderStage.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="clickSelectFromGalleryBtn1" />
71+
<waitForPageLoad stepKey="waitForPageLoad"/>
72+
</actionGroup>
73+
<actionGroup name="verifySelectFromGalleryButtonWorks">
74+
<arguments>
75+
<argument name="contentType"/>
76+
<argument name="index" defaultValue="1" type="string"/>
77+
<argument name="x" defaultValue="null" type="string"/>
78+
<argument name="y" defaultValue="null" type="string"/>
79+
</arguments>
80+
<comment userInput="verifySelectFromGalleryButtonWorks" stepKey="comment"/>
81+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, index)}}" x="{{x}}" y="{{y}}" stepKey="mouseOverContentType"/>
7182
<waitForPageLoad stepKey="waitForPageLoad"/>
83+
<waitForElementVisible selector="{{PageBuilderStage.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="waitForSelectFromGallery"/>
84+
<click selector="{{PageBuilderStage.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="clickSelectFromGallery"/>
85+
<waitForPageLoad stepKey="waitForPageLoad1"/>
86+
<waitForElementVisible selector="{{MediaGallerySection.InsertFile}}" stepKey="waitForAddSelectedFilesButton"/>
87+
<seeElement selector="{{MediaGallerySection.InsertFile}}" stepKey="seeAddSelectedFilesButton"/>
88+
<click selector="{{MediaGallerySection.CancelBtn}}" stepKey="clickCancelButton"/>
89+
<waitForPageLoad stepKey="waitForPageLoad2"/>
7290
</actionGroup>
7391
<actionGroup name="uploadImageToContentTypeFromStage">
7492
<arguments>
@@ -80,4 +98,40 @@
8098
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
8199
<waitForElementVisible selector="{{PageBuilderStage.imageSource(property.fileName)}}" stepKey="waitForMainImageSource1"/>
82100
</actionGroup>
101+
<actionGroup name="inlineEditWYSIWYGFromStage">
102+
<arguments>
103+
<argument name="contentType"/>
104+
<argument name="content" type="string"/>
105+
<argument name="index" defaultValue="1" type="string"/>
106+
</arguments>
107+
<click selector="{{PageBuilderStage.inlineWYSIWYGEditor(contentType.role, index)}}" stepKey="focusOnEditorArea"/>
108+
<waitForElementVisible selector="{{PageBuilderStage.inlineWYSIWYGEditorPanel(contentType.role, index)}}" stepKey="waitForEditorPanel"/>
109+
<fillField selector="{{PageBuilderStage.inlineWYSIWYGEditor(contentType.role, index)}}" userInput="{{content}}" stepKey="enterContentIntoEditor"/>
110+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="loseFocusFromEditor"/>
111+
</actionGroup>
112+
<actionGroup name="inlineEditTextAreaFromStage">
113+
<arguments>
114+
<argument name="contentType"/>
115+
<argument name="content" type="string"/>
116+
<argument name="index" defaultValue="1" type="string"/>
117+
</arguments>
118+
<click selector="{{PageBuilderStage.inlineTextAreaEditor(contentType.role, index)}}" stepKey="focusOnEditorArea"/>
119+
<waitForPageLoad stepKey="waitForPageLoad"/>
120+
<fillField selector="{{PageBuilderStage.inlineTextAreaEditor(contentType.role, index)}}" userInput="{{content}}" stepKey="enterContentIntoEditor"/>
121+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="loseFocusFromEditor"/>
122+
</actionGroup>
123+
<actionGroup name="verifyUploadImageButtons">
124+
<arguments>
125+
<argument name="contentType"/>
126+
<argument name="section" defaultValue="PageBuilderStage"/>
127+
<argument name="index" defaultValue="1" type="string"/>
128+
<argument name="x" defaultValue="null" type="string"/>
129+
<argument name="y" defaultValue="null" type="string"/>
130+
</arguments>
131+
<comment userInput="Verify Upload Image and Select From Gallery buttons appear on hover" stepKey="comment"/>
132+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, index)}}" x="{{x}}" y="{{y}}" stepKey="mouseOverContentType"/>
133+
<waitForPageLoad stepKey="waitForPageLoad"/>
134+
<seeElement selector="{{section.onHoverUploadImageButton(contentType.role, index)}}" stepKey="seeUploadImageButton" />
135+
<seeElement selector="{{section.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="seeSelectFromGalleryButton"/>
136+
</actionGroup>
83137
</actionGroups>

0 commit comments

Comments
 (0)