|
50 | 50 | <actualResult type="variable">ratioDifference</actualResult>
|
51 | 51 | </assertLessThanOrEqual>
|
52 | 52 | </actionGroup>
|
53 |
| - <actionGroup name="validateVideoUrl"> |
54 |
| - <annotations> |
55 |
| - <description>Validates that the video's url in the video content type.</description> |
56 |
| - </annotations> |
57 |
| - <arguments> |
58 |
| - <argument name="page" defaultValue="VideoOnStage"/> |
59 |
| - <argument name="index" defaultValue="1" type="string"/> |
60 |
| - <argument name="url" defaultValue="PageBuilderVideoUrl_YouTube"/> |
61 |
| - <argument name="acceptableOffset" defaultValue="2" type="string"/> |
62 |
| - </arguments> |
63 |
| - <waitForElementVisible selector="{{page.videoElement(index)}}" stepKey="waitForVideoElement"/> |
64 |
| - <waitForElementVisible selector="{{page.videoUrl(index, url.renderedValue)}}" stepKey="waitForVideoUrl"/> |
65 |
| - </actionGroup> |
66 |
| - <actionGroup name="validateVideoAspectRatio"> |
67 |
| - <annotations> |
68 |
| - <description>Validates that the video in the video content type has the correct aspect ratio.</description> |
69 |
| - </annotations> |
| 53 | + <actionGroup name="validateVideoWithOnlyVideoUrl"> |
70 | 54 | <arguments>
|
71 |
| - <argument name="page" defaultValue="VideoOnStage"/> |
| 55 | + <argument name="page" defaultValue=""/> |
72 | 56 | <argument name="index" defaultValue="1" type="string"/>
|
| 57 | + <argument name="url" defaultValue=""/> |
| 58 | + <!-- This is 2 because the width and the height may both have fractions that could round by a maximum of 1 for each which makes the maximum 2--> |
73 | 59 | <argument name="acceptableOffset" defaultValue="2" type="string"/>
|
74 | 60 | </arguments>
|
75 |
| - <waitForElementVisible selector="{{page.iframe(index)}}" stepKey="waitForVideoIFrame"/> |
| 61 | + <waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForElement"/> |
| 62 | + <waitForElementVisible selector="{{page.source(index, url.renderedValue)}}" stepKey="waitForUrl"/> |
| 63 | + <waitForElementVisible selector="{{page.noWidth(index)}}" stepKey="waitForWidth"/> |
| 64 | + <comment userInput="Validate Aspect Ratio" stepKey="commentValidateAspectRatio"/> |
76 | 65 | <executeJS function="return window.calculatedHeight = parseInt(getComputedStyle(document.evaluate("{{page.iframe(index)}}",document.body).iterateNext()).width) / 16 * 9" stepKey="calculatedHeight"/>
|
77 | 66 | <executeJS function="return window.actualHeight = parseInt(getComputedStyle(document.evaluate("{{page.iframe(index)}}",document.body).iterateNext()).height)" stepKey="actualHeight"/>
|
78 | 67 | <executeJS function="return Math.abs(window.calculatedHeight - window.actualHeight)" stepKey="ratioDifference"/>
|
79 | 68 | <assertLessThanOrEqual stepKey="assertRatio">
|
80 | 69 | <expectedResult type="int">{{acceptableOffset}}</expectedResult>
|
81 | 70 | <actualResult type="variable">ratioDifference</actualResult>
|
82 | 71 | </assertLessThanOrEqual>
|
| 72 | + <grabAttributeFrom selector="{{page.iframe(index)}}" userInput="src" stepKey="videoSrc"/> |
| 73 | + <assertNotContains stepKey="assertNoAutoplay"> |
| 74 | + <expectedResult type="string">autoplay</expectedResult> |
| 75 | + <actualResult type="variable">$videoSrc</actualResult> |
| 76 | + </assertNotContains> |
83 | 77 | </actionGroup>
|
84 |
| - <actionGroup name="validateVideoAutoPlay"> |
85 |
| - <annotations> |
86 |
| - <description>Validates that the video content type has the autoplay attributes.</description> |
87 |
| - </annotations> |
| 78 | + <actionGroup name="validateVideoWithOnlyVideoUrlMp4"> |
88 | 79 | <arguments>
|
89 |
| - <argument name="page" defaultValue="VideoOnStage"/> |
| 80 | + <argument name="page" defaultValue=""/> |
90 | 81 | <argument name="index" defaultValue="1" type="string"/>
|
| 82 | + <argument name="url" defaultValue=""/> |
| 83 | + <!-- This is 2 because the width and the height may both have fractions that could round by a maximum of 1 for each which makes the maximum 2--> |
| 84 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
91 | 85 | </arguments>
|
92 |
| - <waitForPageLoad stepKey="waitForPageLoad"/> |
93 |
| - <waitForElementVisible selector="{{page.videoElement(index)}}" stepKey="waitForVideoElement"/> |
94 |
| - <waitForElementVisible selector="{{page.videoAutoplay(index)}}" stepKey="waitForVideoAutoplay"/> |
95 |
| - <grabAttributeFrom selector="{{page.videoElement(index)}}" userInput="src" stepKey="videoSrc"/> |
96 |
| - <assertContains stepKey="assertAutoplay"> |
97 |
| - <expectedResult type="string">autoplay=1</expectedResult> |
98 |
| - <actualResult type="variable">$videoSrc</actualResult> |
99 |
| - </assertContains> |
100 |
| - </actionGroup> |
101 |
| - <actionGroup name="validateVideoNoAutoPlay" extends="validateVideoAutoPlay"> |
102 |
| - <annotations> |
103 |
| - <description>Validates that the video content type does not have the autoplay attributes.</description> |
104 |
| - </annotations> |
105 |
| - <waitForElementVisible selector="{{page.videoNoAutoplay(index)}}" stepKey="waitForVideoAutoplay"/> |
106 |
| - <assertNotContains stepKey="assertAutoplay"> |
107 |
| - <expectedResult type="string">autoplay</expectedResult> |
108 |
| - <actualResult type="variable">$videoSrc</actualResult> |
109 |
| - </assertNotContains> |
| 86 | + <waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForElement"/> |
| 87 | + <waitForElementVisible selector="{{page.sourceVideo(index, url.renderedValue)}}" stepKey="waitForUrl"/> |
| 88 | + <waitForElementVisible selector="{{page.noWidth(index)}}" stepKey="waitForWidth"/> |
| 89 | + <comment userInput="Validate Aspect Ratio" stepKey="commentValidateAspectRatio"/> |
| 90 | + <executeJS function="return window.calculatedHeight = parseInt(getComputedStyle(document.evaluate("{{page.video(index)}}",document.body).iterateNext()).width) / 16 * 9" stepKey="calculatedHeight"/> |
| 91 | + <executeJS function="return window.actualHeight = parseInt(getComputedStyle(document.evaluate("{{page.video(index)}}",document.body).iterateNext()).height)" stepKey="actualHeight"/> |
| 92 | + <executeJS function="return Math.abs(window.calculatedHeight - window.actualHeight)" stepKey="ratioDifference"/> |
| 93 | + <assertLessThanOrEqual stepKey="assertRatio"> |
| 94 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 95 | + <actualResult type="variable">ratioDifference</actualResult> |
| 96 | + </assertLessThanOrEqual> |
| 97 | + <waitForElementNotVisible selector="{{page.videoAutoplay(index)}}" stepKey="assertNoAutoplay"/> |
110 | 98 | </actionGroup>
|
111 | 99 | <actionGroup name="validateVideoPlaying">
|
112 | 100 | <annotations>
|
113 |
| - <description>Validates that the video content type is playing. Only works with videos that play in an iframe.</description> |
| 101 | + <description>Validates that the video content type is playing.</description> |
114 | 102 | </annotations>
|
115 | 103 | <arguments>
|
116 | 104 | <argument name="page" defaultValue="VideoOnStage"/>
|
| 105 | + <argument name="url" defaultValue="PageBuilderVideoUrl_Empty"/> |
117 | 106 | <argument name="index" defaultValue="1" type="string"/>
|
118 | 107 | </arguments>
|
119 | 108 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
120 |
| - <waitForElementVisible selector="{{page.videoElement(index)}}" stepKey="waitForVideoElement"/> |
121 |
| - <executeJS function="document.querySelectorAll('{{page.videoElementCss}}')[{{index}}-1].id = 'video-iframe'" stepKey="setIframeId"/> |
122 |
| - <switchToIFrame selector="video-iframe" stepKey="switchToVideoIframe"/> |
123 |
| - <waitForElementVisible selector="{{page.iframePlaying}}" stepKey="seeIframePlaying"/> |
| 109 | + <waitForElementVisible selector="{{page.videoElement(index)}}" stepKey="waitForVideoVisible"/> |
| 110 | + <executeJS function="document.querySelector('[data-element=\'video\']').id = 'video-iframe'" stepKey="setIframeId"/> |
| 111 | + <switchToIFrame userInput="video-iframe" stepKey="switchToVideoIframe"/> |
| 112 | + <waitForElementVisible selector="{{page.iframePlaying(index)}}" stepKey="seeIframePlaying"/> |
124 | 113 | <switchToIFrame stepKey="switchBackFromIframe"/>
|
125 | 114 | </actionGroup>
|
126 | 115 | <actionGroup name="validateVideoNotAutoplaying" extends="validateVideoPlaying">
|
127 | 116 | <annotations>
|
128 |
| - <description>Validates that the video content type is not autoplaying. Only works with videos that play in an iframe.</description> |
| 117 | + <description>Validates that the video content type is not autoplaying.</description> |
129 | 118 | </annotations>
|
130 |
| - <waitForElementVisible selector="{{page.iframeNotAutoplaying}}" stepKey="seeIframePlaying"/> |
| 119 | + <waitForElementVisible selector="{{page.iframeNotAutoplaying(index)}}" stepKey="seeIframePlaying"/> |
131 | 120 | </actionGroup>
|
132 | 121 | <actionGroup name="validateEmptyVideoStage">
|
133 |
| - <annotations> |
134 |
| - <description>Validates that the video content type on the stage in admin is empty.</description> |
135 |
| - </annotations> |
136 | 122 | <arguments>
|
137 | 123 | <argument name="index" defaultValue="1" type="string"/>
|
138 | 124 | </arguments>
|
|
0 commit comments