|
212 | 212 | </arguments>
|
213 | 213 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
214 | 214 | <waitForElementVisible selector="{{section.backgroundType(index, 'video')}}" stepKey="waitForVideoBackground"/>
|
| 215 | + <waitForElement selector="{{section.backgroundColorElement(index)}}" stepKey="waitForVideoBackgroundColor"/> |
215 | 216 | <executeJS function="return window.getComputedStyle(document.evaluate("{{section.backgroundColorElement(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue).backgroundColor" stepKey="backgroundColor"/>
|
216 | 217 | <assertEquals stepKey="assertBackgroundColor">
|
217 | 218 | <expectedResult type="string">{{backgroundColor}}</expectedResult>
|
|
303 | 304 | <actualResult type="variable">$fallbackImageStyle</actualResult>
|
304 | 305 | </assertContains>
|
305 | 306 | </actionGroup>
|
| 307 | + <actionGroup name="validateFallbackImageAfterVideoFinishesPlayingInVideoBackground"> |
| 308 | + <annotations> |
| 309 | + <description>Validates that the video background fallback image renders when the video in video background finishes playing.</description> |
| 310 | + </annotations> |
| 311 | + <arguments> |
| 312 | + <argument name="section" defaultValue="RowOnStage"/> |
| 313 | + <argument name="fallbackImage" defaultValue="PageBuilderVideoBackgroundFallbackImage_Empty"/> |
| 314 | + <argument name="index" defaultValue="1" type="string"/> |
| 315 | + </arguments> |
| 316 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 317 | + <waitForElementVisible selector="{{section.backgroundType(index, 'video')}}" stepKey="waitForVideoBackground"/> |
| 318 | + <waitForElementVisible selector="{{section.videoBackgroundVideoElement(index)}}" stepKey="waitForVideo"/> |
| 319 | + <waitForElementVisible selector="{{section.videoBackgroundFallbackImage(index)}}" stepKey="waitForFallbackImageVisible"/> |
| 320 | + <grabAttributeFrom selector="{{section.videoBackgroundFallbackImageSource(index, fallbackImage.fileName)}}" userInput="src" stepKey="fallbackImageSource"/> |
| 321 | + <assertRegExp stepKey="assertFallbackImageValueContainsFileInformation"> |
| 322 | + <expectedResult type="string">/.*\/(pub\/|\/)?media\/{{fallbackImage.path}}\/{{fallbackImage.fileName}}(_\d+)?\.{{fallbackImage.extension}}/</expectedResult> |
| 323 | + <actualResult type="variable">$fallbackImageSource</actualResult> |
| 324 | + </assertRegExp> |
| 325 | + <grabAttributeFrom selector="{{section.videoBackgroundFallbackImageSource(index, fallbackImage.fileName)}}" userInput="style" stepKey="fallbackImageStyle"/> |
| 326 | + <assertContains stepKey="assertCover"> |
| 327 | + <expectedResult type="string">display: block;</expectedResult> |
| 328 | + <actualResult type="variable">$fallbackImageStyle</actualResult> |
| 329 | + </assertContains> |
| 330 | + </actionGroup> |
306 | 331 | <actionGroup name="validateEmptyRowWithInvalidVideoBackgroundAndNoFallbackImage">
|
307 | 332 | <annotations>
|
308 | 333 | <description>Validates that the Row renders as an empty row when the video in video background fails to load and there is no fallback image.</description>
|
|
381 | 406 | <expectedResult type="string">transform: translate3d(</expectedResult>
|
382 | 407 | <actualResult type="variable">$videoStyle</actualResult>
|
383 | 408 | </assertContains>
|
| 409 | + <waitForElement selector="{{section.videoBackgroundFallbackImage(index)}}|{{section.videoBackgroundNoFallbackImage(index)}}" stepKey="waitForFallbackImage"/> |
| 410 | + <grabAttributeFrom selector="{{section.videoBackgroundFallbackImage(index)}}|{{section.videoBackgroundNoFallbackImage(index)}}" userInput="style" stepKey="fallbackImageStyle"/> |
| 411 | + <assertContains stepKey="assertFallbackImageNotDisplayed"> |
| 412 | + <expectedResult type="string">display: none;</expectedResult> |
| 413 | + <actualResult type="variable">$fallbackImageStyle</actualResult> |
| 414 | + </assertContains> |
| 415 | + </actionGroup> |
| 416 | + <actionGroup name="validateVideoBackgroundLoadedButNotPlaying" extends="validateVideoBackgroundPlaying"> |
| 417 | + <annotations> |
| 418 | + <description>Validates that the video in the video background is loaded but not playing.</description> |
| 419 | + </annotations> |
| 420 | + <assertNotContains stepKey="assertVideoPlaying"> |
| 421 | + <expectedResult type="string">transform: translate3d(</expectedResult> |
| 422 | + <actualResult type="variable">$videoStyle</actualResult> |
| 423 | + </assertNotContains> |
| 424 | + </actionGroup> |
| 425 | + <actionGroup name="validateVideoBackgroundFinishedPlaying" extends="validateVideoBackgroundPlaying"> |
| 426 | + <annotations> |
| 427 | + <description>Validates that the video in the video background is finished playing.</description> |
| 428 | + </annotations> |
| 429 | + <assertContains stepKey="assertFallbackImageNotDisplayed"> |
| 430 | + <expectedResult type="string">display: block;</expectedResult> |
| 431 | + <actualResult type="variable">$fallbackImageStyle</actualResult> |
| 432 | + </assertContains> |
384 | 433 | </actionGroup>
|
385 |
| - <actionGroup name="validateVideoBackgroundNotPlaying" extends="validateVideoBackgroundPlaying"> |
| 434 | + <actionGroup name="validateVideoBackgroundFinishedPlayingBeforeViewing" extends="validateVideoBackgroundPlaying"> |
386 | 435 | <annotations>
|
387 |
| - <description>Validates that the video in the video background is not playing.</description> |
| 436 | + <description>Validates that the video in the video background is finished playing before it's in the viewport.</description> |
388 | 437 | </annotations>
|
389 | 438 | <assertNotContains stepKey="assertVideoPlaying">
|
390 | 439 | <expectedResult type="string">transform: translate3d(</expectedResult>
|
391 | 440 | <actualResult type="variable">$videoStyle</actualResult>
|
392 | 441 | </assertNotContains>
|
| 442 | + <assertContains stepKey="assertFallbackImageNotDisplayed"> |
| 443 | + <expectedResult type="string">display: block;</expectedResult> |
| 444 | + <actualResult type="variable">$fallbackImageStyle</actualResult> |
| 445 | + </assertContains> |
393 | 446 | </actionGroup>
|
394 | 447 | <actionGroup name="validateVideoBackgroundLoaded">
|
395 | 448 | <annotations>
|
|
0 commit comments