Skip to content

Commit 385c1f2

Browse files
committed
#636-functional-tests-on-mobile-viewport
- fix ViewportSwitcherMobileSlideItemPosterAppearanceThroughBlockContentTypeTest
1 parent ef750bd commit 385c1f2

File tree

1 file changed

+136
-19
lines changed

1 file changed

+136
-19
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Test/ViewportSwitcherMobile/ViewportSwitcherMobileSlideItemPosterAppearanceThroughBlockContentTypeTest.xml

Lines changed: 136 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,56 @@
121121
<argument name="viewportButton" value="mobile"/>
122122
<argument name="viewportStage" value="mobile"/>
123123
</actionGroup>
124+
<seeElement selector="{{SlideOnBackend.appearance('1', PageBuilderAppearance_Poster.value)}}" stepKey="seeAppearanceCMSBlockStageMobile"/>
125+
<actionGroup ref="validateOverlayPositionPoster" stepKey="validateOverlayPositionCMSBlockStageMobile">
126+
<argument name="page" value="SlideOnBackend"/>
127+
</actionGroup>
128+
<seeElement selector="{{SlideOnBackend.slideName('1', PageBuilderSlideItemSlideName_Slide1.value)}}" stepKey="seeSlideNameCMSBlockStageMobile"/>
129+
<moveMouseOver selector="{{SliderOnStage.activeSlideNavigationDot}}" stepKey="mouseOverSlideDotCMSBlockStageMobile"/>
130+
<see userInput="{{PageBuilderSlideItemSlideName_Slide1.value}}" selector="{{SliderOnStage.slideNavigationDotNameTooltip('1')}}" stepKey="seeSlideName1InTooltipCMSBlockStageMobile"/>
131+
<seeElement selector="{{SlideOnBackend.posterMinimumHeight('1', PageBuilderMinHeightProperty_200px.value)}}" stepKey="seeMinimumHeightCMSBlockStageMobile"/>
132+
<actionGroup ref="validateContentTypeHeightEqualToMinHeightPlusPaddingAndBorder" stepKey="validateHeightCMSBlockStageMobile">
133+
<argument name="content" value="{{SlideOnBackend.wrapperCSS}}"/>
134+
<argument name="minHeight" value="{{PageBuilderMinHeightProperty_200px.intValue}}"/>
135+
</actionGroup>
136+
<actionGroup ref="validateBackgroundAttributesWithNoImageForSlide" stepKey="validateBackgroundAttributesCMSBlockStageMobile">
137+
<argument name="section" value="SlideOnBackend"/>
138+
<argument name="backgroundColor" value="PageBuilderBackgroundColor_Plaintext_Green"/>
139+
<argument name="backgroundPosition" value="PageBuilderBackgroundPosition_Center"/>
140+
<argument name="backgroundSize" value="PageBuilderBackgroundSize_Auto"/>
141+
<argument name="backgroundRepeat" value="PageBuilderBackgroundRepeat_Enabled"/>
142+
<argument name="backgroundAttachment" value="PageBuilderBackgroundAttachment_Fixed"/>
143+
</actionGroup>
144+
<actionGroup ref="validateBackgroundImage" stepKey="validateBackgroundImageCMSBlockStageMobile">
145+
<argument name="section" value="SlideOnBackend"/>
146+
<argument name="backgroundImage" value="PageBuilderBackgroundMobileImage_GIF"/>
147+
</actionGroup>
148+
<seeElement selector="{{SlideOnBackend.messageContent('1', PageBuilderSlideItemContent_Slide1.value)}}" stepKey="seeMessageContentCMSBlockStageMobile"/>
149+
<seeElementInDOM selector="{{SlideOnBackend.button('1')}}" stepKey="seeButtonInDOMCMSBlockStageMobile"/>
150+
<dontSeeElement selector="{{SlideOnBackend.button('1')}}" stepKey="dontSeeButtonCMSBlockStageMobile"/>
151+
<seeElement selector="{{SlideOnBackend.transparentOverlay('1')}}" stepKey="seeTransparentOverlayCMSBlockStageMobile"/>
152+
<moveMouseOver selector="{{SlideOnBackend.appearance('1', PageBuilderAppearance_Poster.value)}}" stepKey="moveMouseOverSlideCMSBlockStageMobile"/>
153+
<seeElement selector="{{SlideOnBackend.button('1')}}" stepKey="seeButtonOnHoverCMSBlockStageMobile"/>
154+
<seeElement selector="{{SlideOnBackend.buttonText('1', PageBuilderSlideItemButtonText_Common.value)}}" stepKey="seeButtonTextOnHoverCMSBlockStageMobile"/>
155+
<seeElement selector="{{SlideOnBackend.buttonType('1', PageBuilderSlideItemButtonType_Secondary.value)}}" stepKey="seeButtonTypeOnHoverCMSBlockStageMobile"/>
156+
<seeElement selector="{{SlideOnBackend.overlayBackgroundColor('1', PageBuilderSlideItemOverlayColor_Blue_Opaque.value)}}" stepKey="seeOverlayOnHoverCMSBlockStageMobile"/>
157+
<executeJS function="return {{SlideOnBackend.overlayJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPositionCMSBlockStageMobile"/>
158+
<executeJS function="return document.evaluate(&quot;{{SlideOnBackend.button('1')}}&quot;, document.body).iterateNext().getBoundingClientRect().left" stepKey="buttonLeftPositionCMSBlockStageMobile"/>
159+
<executeJS function="return Math.abs(Math.round({$buttonLeftPositionCMSBlockStageMobile}-{$overlayLeftPositionCMSBlockStageMobile}-{{PageBuilderPaddingProperty40.paddingLeft}}))" stepKey="buttonMinusOverlayMinusPaddingCMSBlockStageMobile"/>
160+
<assertLessThanOrEqual stepKey="assertButtonLeftAlignedCMSBlockStageMobile">
161+
<expectedResult type="int">5</expectedResult>
162+
<actualResult type="variable">buttonMinusOverlayMinusPaddingCMSBlockStageMobile</actualResult>
163+
</assertLessThanOrEqual>
164+
<executeJS function="return window.getComputedStyle({{SlideOnBackend.wrapperJS('1')}}).textAlign" stepKey="grabDefaultComputedTextAlignCMSBlockStageMobile"/>
165+
<assertEquals stepKey="assertDefaultComputedTextAlignCMSBlockStageMobile">
166+
<expectedResult type="string">{{PageBuilderAdvancedAlignmentPropertyLeft.value}}</expectedResult>
167+
<actualResult type="variable">grabDefaultComputedTextAlignCMSBlockStageMobile</actualResult>
168+
</assertEquals>
169+
<!-- Validate CMS Block Stage Desktop Viewport-->
170+
<actionGroup ref="AdminSwitchPageBuilderViewportActionGroup" stepKey="switchToDesktopViewport">
171+
<argument name="viewportButton" value="desktop"/>
172+
<argument name="viewportStage" value="desktop"/>
173+
</actionGroup>
124174
<seeElement selector="{{SlideOnBackend.appearance('1', PageBuilderAppearance_Poster.value)}}" stepKey="seeAppearanceCMSBlockStage"/>
125175
<actionGroup ref="validateOverlayPositionPoster" stepKey="validateOverlayPositionCMSBlockStage">
126176
<argument name="page" value="SlideOnBackend"/>
@@ -143,7 +193,7 @@
143193
</actionGroup>
144194
<actionGroup ref="validateBackgroundImage" stepKey="validateBackgroundImageCMSBlockStage">
145195
<argument name="section" value="SlideOnBackend"/>
146-
<argument name="backgroundImage" value="PageBuilderBackgroundMobileImage_GIF"/>
196+
<argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/>
147197
</actionGroup>
148198
<seeElement selector="{{SlideOnBackend.messageContent('1', PageBuilderSlideItemContent_Slide1.value)}}" stepKey="seeMessageContentCMSBlockStage"/>
149199
<seeElementInDOM selector="{{SlideOnBackend.button('1')}}" stepKey="seeButtonInDOMCMSBlockStage"/>
@@ -189,45 +239,112 @@
189239
</actionGroup>
190240
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsBlock"/>
191241
<!-- Validate CMS Page Stage Mobile Viewport-->
192-
<seeElement selector="{{SlideOnFrontend.appearance('1', PageBuilderAppearance_Poster.value)}}" stepKey="seeAppearanceCMSPageStage"/>
193-
<actionGroup ref="validateOverlayPositionPoster" stepKey="validateOverlayPositionCMSPageStage">
242+
<seeElement selector="{{SlideOnFrontend.appearance('1', PageBuilderAppearance_Poster.value)}}" stepKey="seeAppearanceCMSPageStageMobile"/>
243+
<actionGroup ref="validateOverlayPositionPoster" stepKey="validateOverlayPositionCMSPageStageMobile">
194244
<argument name="page" value="SlideOnFrontend"/>
195245
</actionGroup>
196-
<seeElement selector="{{SlideOnFrontend.minimumHeight('1', PageBuilderMinHeightProperty_200px.value)}}" stepKey="seeMinimumHeightCMSPageStage"/>
197-
<actionGroup ref="validateContentTypeHeightEqualToMinHeightPlusPaddingAndBorder" stepKey="validateHeightCMSPageStage">
246+
<seeElement selector="{{SlideOnFrontend.minimumHeight('1', PageBuilderMinHeightProperty_200px.value)}}" stepKey="seeMinimumHeightCMSPageStageMobile"/>
247+
<actionGroup ref="validateContentTypeHeightEqualToMinHeightPlusPaddingAndBorder" stepKey="validateHeightCMSPageStageMobile">
198248
<argument name="content" value="{{SlideOnFrontend.wrapperCSS}}"/>
199249
<argument name="minHeight" value="{{PageBuilderMinHeightProperty_200px.intValue}}"/>
200250
</actionGroup>
201-
<actionGroup ref="validateBackgroundAttributesWithNoImageForSlide" stepKey="validateBackgroundAttributesCMSPageStage">
251+
<actionGroup ref="validateBackgroundAttributesWithNoImageForSlide" stepKey="validateBackgroundAttributesCMSPageStageMobile">
202252
<argument name="section" value="SlideOnFrontend"/>
203253
<argument name="backgroundColor" value="PageBuilderBackgroundColor_Plaintext_Green"/>
204254
<argument name="backgroundPosition" value="PageBuilderBackgroundPosition_Center"/>
205255
<argument name="backgroundSize" value="PageBuilderBackgroundSize_Auto"/>
206256
<argument name="backgroundRepeat" value="PageBuilderBackgroundRepeat_Enabled"/>
207257
<argument name="backgroundAttachment" value="PageBuilderBackgroundAttachment_Fixed"/>
208258
</actionGroup>
209-
<actionGroup ref="validateBackgroundImageContainer" stepKey="validateBackgroundImageCMSPageStage">
259+
<actionGroup ref="validateBackgroundImageContainer" stepKey="validateBackgroundImageCMSPageStageMobile">
210260
<argument name="section" value="SlideOnFrontend"/>
211261
<argument name="backgroundImage" value="PageBuilderBackgroundMobileImage_GIF"/>
212262
</actionGroup>
213-
<seeElement selector="{{SlideOnFrontend.messageContent('1', PageBuilderSlideItemContent_Slide1.value)}}" stepKey="seeMessageContentCMSPageStage"/>
214-
<seeElementInDOM selector="{{SlideOnFrontend.button('1')}}" stepKey="seeButtonInDOMCMSPageStage"/>
215-
<dontSeeElement selector="{{SlideOnFrontend.button('1')}}" stepKey="dontSeeButtonCMSPageStage"/>
216-
<seeElement selector="{{SlideOnFrontend.transparentOverlay('1')}}" stepKey="seeTransparentOverlayCMSPageStage"/>
217-
<executeJS function="return {{SlideOnFrontend.overlayJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPositionCMSPageStage"/>
218-
<executeJS function="return document.evaluate(&quot;{{SlideOnFrontend.button('1')}}&quot;, document.body).iterateNext().getBoundingClientRect().left" stepKey="buttonLeftPositionCMSPageStage"/>
219-
<executeJS function="return Math.abs(Math.round({$buttonLeftPositionCMSPageStage}-{$overlayLeftPositionCMSPageStage}-{{PageBuilderPaddingProperty40.paddingLeft}}))" stepKey="buttonMinusOverlayMinusPaddingCMSPageStage"/>
263+
<seeElement selector="{{SlideOnFrontend.messageContent('1', PageBuilderSlideItemContent_Slide1.value)}}" stepKey="seeMessageContentCMSPageStageMobile"/>
264+
<seeElementInDOM selector="{{SlideOnFrontend.button('1')}}" stepKey="seeButtonInDOMCMSPageStageMobile"/>
265+
<dontSeeElement selector="{{SlideOnFrontend.button('1')}}" stepKey="dontSeeButtonCMSPageStageMobile"/>
266+
<seeElement selector="{{SlideOnFrontend.transparentOverlay('1')}}" stepKey="seeTransparentOverlayCMSPageStageMobile"/>
267+
<executeJS function="return {{SlideOnFrontend.overlayJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPositionCMSPageStageMobile"/>
268+
<executeJS function="return document.evaluate(&quot;{{SlideOnFrontend.button('1')}}&quot;, document.body).iterateNext().getBoundingClientRect().left" stepKey="buttonLeftPositionCMSPageStageMobile"/>
269+
<executeJS function="return Math.abs(Math.round({$buttonLeftPositionCMSPageStageMobile}-{$overlayLeftPositionCMSPageStageMobile}-{{PageBuilderPaddingProperty40.paddingLeft}}))" stepKey="buttonMinusOverlayMinusPaddingCMSPageStageMobile"/>
220270
<assertLessThanOrEqual stepKey="assertButtonLeftAlignedCMSPageStage">
221271
<expectedResult type="int">5</expectedResult>
222-
<actualResult type="variable">buttonMinusOverlayMinusPaddingCMSPageStage</actualResult>
272+
<actualResult type="variable">buttonMinusOverlayMinusPaddingCMSPageStageMobile</actualResult>
223273
</assertLessThanOrEqual>
224-
<executeJS function="return window.getComputedStyle({{SlideOnFrontend.wrapperJS('1')}}).textAlign" stepKey="grabDefaultComputedTextAlignCMSPageStage"/>
274+
<executeJS function="return window.getComputedStyle({{SlideOnFrontend.wrapperJS('1')}}).textAlign" stepKey="grabDefaultComputedTextAlignCMSPageStageMobile"/>
225275
<assertEquals stepKey="assertDefaultComputedTextAlignCMSPageStage">
226276
<expectedResult type="string">{{PageBuilderAdvancedAlignmentPropertyLeft.value}}</expectedResult>
227-
<actualResult type="variable">grabDefaultComputedTextAlignCMSPageStage</actualResult>
277+
<actualResult type="variable">grabDefaultComputedTextAlignCMSPageStageMobile</actualResult>
228278
</assertEquals>
229-
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/>
230-
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/>
279+
<!-- Validate CMS Block Stage Desktop Viewport after Save-->
280+
<actionGroup ref="AdminSwitchPageBuilderViewportActionGroup" stepKey="switchToDesktopViewportAfterSave">
281+
<argument name="viewportButton" value="desktop"/>
282+
<argument name="viewportStage" value="desktop"/>
283+
</actionGroup>
284+
<seeElement selector="{{SlideOnFrontend.appearance('1', PageBuilderAppearance_Poster.value)}}" stepKey="seeAppearanceCMSPageStageAfterSave"/>
285+
<actionGroup ref="validateOverlayPositionPoster" stepKey="validateOverlayPositionCMSPageStageAfterSave">
286+
<argument name="page" value="SlideOnFrontend"/>
287+
</actionGroup>
288+
<seeElement selector="{{SlideOnFrontend.minimumHeight('1', PageBuilderMinHeightProperty_200px.value)}}" stepKey="seeMinimumHeightCMSPageStageAfterSave"/>
289+
<actionGroup ref="validateContentTypeHeightEqualToMinHeightPlusPaddingAndBorder" stepKey="validateHeightCMSPageStageAfterSave">
290+
<argument name="content" value="{{SlideOnFrontend.wrapperCSS}}"/>
291+
<argument name="minHeight" value="{{PageBuilderMinHeightProperty_200px.intValue}}"/>
292+
</actionGroup>
293+
<actionGroup ref="validateBackgroundAttributesWithNoImageForSlide" stepKey="validateBackgroundAttributesCMSPageStageAfterSave">
294+
<argument name="section" value="SlideOnFrontend"/>
295+
<argument name="backgroundColor" value="PageBuilderBackgroundColor_Plaintext_Green"/>
296+
<argument name="backgroundPosition" value="PageBuilderBackgroundPosition_Center"/>
297+
<argument name="backgroundSize" value="PageBuilderBackgroundSize_Auto"/>
298+
<argument name="backgroundRepeat" value="PageBuilderBackgroundRepeat_Enabled"/>
299+
<argument name="backgroundAttachment" value="PageBuilderBackgroundAttachment_Fixed"/>
300+
</actionGroup>
301+
<actionGroup ref="validateBackgroundImageContainer" stepKey="validateBackgroundImageCMSPageStageAfterSave">
302+
<argument name="section" value="SlideOnFrontend"/>
303+
<argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/>
304+
</actionGroup>
305+
<seeElement selector="{{SlideOnFrontend.messageContent('1', PageBuilderSlideItemContent_Slide1.value)}}" stepKey="seeMessageContentCMSPageStageAfterSave"/>
306+
<seeElementInDOM selector="{{SlideOnFrontend.button('1')}}" stepKey="seeButtonInDOMCMSPageStageAfterSave"/>
307+
<dontSeeElement selector="{{SlideOnFrontend.button('1')}}" stepKey="dontSeeButtonCMSPageStageAfterSave"/>
308+
<seeElement selector="{{SlideOnFrontend.transparentOverlay('1')}}" stepKey="seeTransparentOverlayCMSPageStageAfterSave"/>
309+
<executeJS function="return {{SlideOnFrontend.overlayJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPositionCMSPageStageAfterSave"/>
310+
<executeJS function="return document.evaluate(&quot;{{SlideOnFrontend.button('1')}}&quot;, document.body).iterateNext().getBoundingClientRect().left" stepKey="buttonLeftPositionCMSPageStageAfterSave"/>
311+
<executeJS function="return Math.abs(Math.round({$buttonLeftPositionCMSPageStageAfterSave}-{$overlayLeftPositionCMSPageStageAfterSave}-{{PageBuilderPaddingProperty40.paddingLeft}}))" stepKey="buttonMinusOverlayMinusPaddingCMSPageStageAfterSave"/>
312+
<assertLessThanOrEqual stepKey="assertButtonLeftAlignedCMSPageStageAfterSave">
313+
<expectedResult type="int">5</expectedResult>
314+
<actualResult type="variable">buttonMinusOverlayMinusPaddingCMSPageStageAfterSave</actualResult>
315+
</assertLessThanOrEqual>
316+
<executeJS function="return window.getComputedStyle({{SlideOnFrontend.wrapperJS('1')}}).textAlign" stepKey="grabDefaultComputedTextAlignCMSPageStageAfterSave"/>
317+
<assertEquals stepKey="assertDefaultComputedTextAlignCMSPageStageAfterSave">
318+
<expectedResult type="string">{{PageBuilderAdvancedAlignmentPropertyLeft.value}}</expectedResult>
319+
<actualResult type="variable">grabDefaultComputedTextAlignCMSPageStageAfterSave</actualResult>
320+
</assertEquals>
321+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreenAfterSave"/>
322+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPageAfterSave"/>
323+
<!-- Validate CMS Page Storefront Desktop -->
324+
<actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToCMSPageStoreFront">
325+
<argument name="page" value="$$createCMSPage.identifier$$"/>
326+
</actionGroup>
327+
<actionGroup ref="validateOverlayPositionPoster" stepKey="validateOverlayPositionCMSPageStorefront">
328+
<argument name="page" value="SlideOnFrontend"/>
329+
</actionGroup>
330+
<actionGroup ref="validateContentTypeHeightEqualToMinHeightPlusPaddingAndBorder" stepKey="validateHeightCMSPageStorefront">
331+
<argument name="content" value="{{SlideOnFrontend.wrapperCSS}}"/>
332+
<argument name="minHeight" value="{{PageBuilderMinHeightProperty_200px.intValue}}"/>
333+
</actionGroup>
334+
<actionGroup ref="validateBackgroundImageContainer" stepKey="validateBackgroundImageCMSPageStorefront">
335+
<argument name="section" value="SlideOnFrontend"/>
336+
<argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/>
337+
</actionGroup>
338+
<seeElementInDOM selector="{{SlideOnFrontend.button('1')}}" stepKey="seeButtonInDOMCMSPageStorefront"/>
339+
<dontSeeElement selector="{{SlideOnFrontend.button('1')}}" stepKey="dontSeeButtonCMSPageStorefront"/>
340+
<seeElement selector="{{SlideOnFrontend.transparentOverlay('1')}}" stepKey="seeTransparentOverlayCMSPageStorefront"/>
341+
<moveMouseOver selector="{{SlideOnFrontend.base('1')}}" stepKey="moveMouseOverSlideCMSPageStorefront"/>
342+
<seeElement selector="{{SlideOnFrontend.button('1')}}" stepKey="seeButtonOnHoverCMSPageStorefront"/>
343+
<seeElement selector="{{SlideOnFrontend.overlayBackgroundColor('1', PageBuilderSlideItemOverlayColor_Blue_Opaque.value)}}" stepKey="seeOverlayOnHoverCMSPageStorefront"/>
344+
<!-- Validate Slide Link Desktop -->
345+
<click selector="{{SlideOnFrontend.linkUrl('1', PageBuilderSlideItemLinkURL_External.value)}}" stepKey="clickLinkUrlCMSPageStorefront"/>
346+
<wait time="3" stepKey="waitArbitraryTimeForPotentialNavigationToOccurCMSPageStorefront"/>
347+
<seeCurrentUrlEquals url="{{PageBuilderSlideItemLinkURL_External.value}}" stepKey="seeThatUrlIsChangedToButtonUrlCMSPageStorefront"/>
231348
<!-- Validate CMS Page Storefront Mobile -->
232349
<resizeWindow width="767" height="1000" stepKey="resizeWindowToMobile"/>
233350
<actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToCMSPageStoreFrontMobile">

0 commit comments

Comments
 (0)