Skip to content

Commit 6a3b28c

Browse files
Revert "[Owls] PB-425: Update Video Alignment MFTF Video Tests"
1 parent 98c6d16 commit 6a3b28c

File tree

13 files changed

+316
-291
lines changed

13 files changed

+316
-291
lines changed

app/code/Magento/CatalogPageBuilderAnalytics/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
},
77
"require": {
88
"magento/module-page-builder-analytics": "*",
9-
"magento/module-catalog": "~103.0.5-alpha2",
10-
"magento/framework": "~102.0.5-alpha2",
9+
"magento/module-catalog": "*",
10+
"magento/framework": "*",
1111
"php": "~7.1.3||~7.2.0||~7.3.0"
1212
},
1313
"type": "magento2-module",

app/code/Magento/CmsPageBuilderAnalytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"require": {
88
"magento/module-page-builder-analytics": "*",
99
"magento/module-cms": "*",
10-
"magento/framework": "~102.0.5-alpha2",
10+
"magento/framework": "*",
1111
"php": "~7.1.3||~7.2.0||~7.3.0"
1212
},
1313
"type": "magento2-module",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,15 +464,15 @@
464464
</arguments>
465465
<waitForPageLoad stepKey="waitForPageLoad"/>
466466
<waitForElement selector="{{section.videoBackgroundJarallaxContainer(index)}}" stepKey="waitForJarallaxContainer"/>
467-
<waitForElement selector="{{section.videoBackgroundVideoElement(index)}}" stepKey="waitForVideo"/>
467+
<seeElement selector="{{section.videoBackgroundVideoElement(index)}}" stepKey="seeVideoInDOM"/>
468468
</actionGroup>
469469
<actionGroup name="validateVideoBackgroundNotLoaded" extends="validateVideoBackgroundLoaded">
470470
<annotations>
471471
<description>Validates that the video in the video background is not loaded.</description>
472472
</annotations>
473-
<dontSeeElementInDOM selector="{{section.videoBackgroundVideoElement(index)}}" stepKey="waitForVideo"/>
473+
<dontSeeElementInDOM selector="{{section.videoBackgroundVideoElement(index)}}" stepKey="seeVideoInDOM"/>
474474
</actionGroup>
475-
<actionGroup name="validateVideoBackgroundVideoAspectRatio">
475+
<actionGroup name="validateVideoAspectRatio">
476476
<annotations>
477477
<description>Validates that the video in the video background has the correct aspect ratio.</description>
478478
</annotations>

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

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -50,89 +50,75 @@
5050
<actualResult type="variable">ratioDifference</actualResult>
5151
</assertLessThanOrEqual>
5252
</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">
7054
<arguments>
71-
<argument name="page" defaultValue="VideoOnStage"/>
55+
<argument name="page" defaultValue=""/>
7256
<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-->
7359
<argument name="acceptableOffset" defaultValue="2" type="string"/>
7460
</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"/>
7665
<executeJS function="return window.calculatedHeight = parseInt(getComputedStyle(document.evaluate(&quot;{{page.iframe(index)}}&quot;,document.body).iterateNext()).width) / 16 * 9" stepKey="calculatedHeight"/>
7766
<executeJS function="return window.actualHeight = parseInt(getComputedStyle(document.evaluate(&quot;{{page.iframe(index)}}&quot;,document.body).iterateNext()).height)" stepKey="actualHeight"/>
7867
<executeJS function="return Math.abs(window.calculatedHeight - window.actualHeight)" stepKey="ratioDifference"/>
7968
<assertLessThanOrEqual stepKey="assertRatio">
8069
<expectedResult type="int">{{acceptableOffset}}</expectedResult>
8170
<actualResult type="variable">ratioDifference</actualResult>
8271
</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>
8377
</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">
8879
<arguments>
89-
<argument name="page" defaultValue="VideoOnStage"/>
80+
<argument name="page" defaultValue=""/>
9081
<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"/>
9185
</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(&quot;{{page.video(index)}}&quot;,document.body).iterateNext()).width) / 16 * 9" stepKey="calculatedHeight"/>
91+
<executeJS function="return window.actualHeight = parseInt(getComputedStyle(document.evaluate(&quot;{{page.video(index)}}&quot;,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"/>
11098
</actionGroup>
11199
<actionGroup name="validateVideoPlaying">
112100
<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>
114102
</annotations>
115103
<arguments>
116104
<argument name="page" defaultValue="VideoOnStage"/>
105+
<argument name="url" defaultValue="PageBuilderVideoUrl_Empty"/>
117106
<argument name="index" defaultValue="1" type="string"/>
118107
</arguments>
119108
<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"/>
124113
<switchToIFrame stepKey="switchBackFromIframe"/>
125114
</actionGroup>
126115
<actionGroup name="validateVideoNotAutoplaying" extends="validateVideoPlaying">
127116
<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>
129118
</annotations>
130-
<waitForElementVisible selector="{{page.iframeNotAutoplaying}}" stepKey="seeIframePlaying"/>
119+
<waitForElementVisible selector="{{page.iframeNotAutoplaying(index)}}" stepKey="seeIframePlaying"/>
131120
</actionGroup>
132121
<actionGroup name="validateEmptyVideoStage">
133-
<annotations>
134-
<description>Validates that the video content type on the stage in admin is empty.</description>
135-
</annotations>
136122
<arguments>
137123
<argument name="index" defaultValue="1" type="string"/>
138124
</arguments>

app/code/Magento/PageBuilder/Test/Mftf/Data/BackgroundFormData.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,15 @@
520520
<data key="fieldName">video_source</data>
521521
<data key="value">https://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
522522
<data key="renderedValue">https://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
523-
<data key="width">320px</data>
524-
<data key="height">320px</data>
525523
</entity>
526524
<entity name="PageBuilderVideoBackgroundUrl_Mp4_URL_Insecure" type="pagebuilder_video_background_url">
527525
<data key="name">Video URL</data>
528526
<data key="section">background</data>
529527
<data key="fieldName">video_source</data>
530528
<data key="value">http://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
531529
<data key="renderedValue">http://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
530+
<data key="width">320px</data>
531+
<data key="height">320px</data>
532532
</entity>
533533
<entity name="PageBuilderVideoBackgroundUrl_Invalid_Text" type="pagebuilder_video_background_url">
534534
<data key="name">Video URL</data>

app/code/Magento/PageBuilder/Test/Mftf/Data/VideoData.xml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@
99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<!-- URL -->
12-
<entity name="PageBuilderVideoUrl_Default" type="pagebuilder_video_url_property" deprecated="Use PageBuilderVideoUrl_Empty instead">
12+
<entity name="PageBuilderVideoUrl_Default" type="pagebuilder_video_url_property">
1313
<data key="name">Video URL</data>
1414
<data key="section">general</data>
1515
<data key="fieldName">video_source</data>
1616
<data key="text">Video</data>
1717
</entity>
18-
<entity name="PageBuilderVideoUrl_Empty" type="pagebuilder_video_url_property">
18+
<entity name="PageBuilderVideoUrl_YouTube" type="pagebuilder_video_url_property">
1919
<data key="name">Video URL</data>
2020
<data key="section">general</data>
2121
<data key="fieldName">video_source</data>
22-
<data key="value"/>
23-
<data key="text">Video</data>
24-
<data key="tooltipText">Video URLs can be links to videos on YouTube or Vimeo, or HTTP(S) links to files with valid video extensions (we recommend .mp4)</data>
22+
<data key="value">https://www.youtube.com/embed/slOtnjsbff0</data>
23+
<data key="renderedValue">https://www.youtube.com/embed/slOtnjsbff0</data>
2524
</entity>
2625
<entity name="PageBuilder_InvalidVideoURL_Text" type="pagebuilder_video_url_property">
2726
<data key="name">Video URL</data>
@@ -37,19 +36,19 @@
3736
<data key="value">&lt;iframe width=&quot;1280&quot; height=&quot;720&quot; src=&quot;https://www.youtube.com/embed/bLXEUP6vKEk"&gt;&lt;/iframe&gt;</data>
3837
<data key="errorMessage">Please enter a valid video URL. Valid URLs have a video file extension (.mp4, .webm, .ogv) or links to videos on YouTube or Vimeo.</data>
3938
</entity>
40-
<entity name="PageBuilderVideoUrl_YouTube" type="pagebuilder_video_url_property">
39+
<entity name="PageBuilderVideoUrl_NonEmbedded" type="pagebuilder_video_url_property">
4140
<data key="name">Video URL</data>
4241
<data key="section">general</data>
4342
<data key="fieldName">video_source</data>
44-
<data key="value">https://www.youtube.com/embed/slOtnjsbff0</data>
43+
<data key="value">https://www.youtube.com/watch?v=slOtnjsbff0</data>
4544
<data key="renderedValue">https://www.youtube.com/embed/slOtnjsbff0</data>
4645
</entity>
47-
<entity name="PageBuilderVideoUrl_NonEmbedded" type="pagebuilder_video_url_property">
46+
<entity name="PageBuilderVideoUrl_Empty" type="pagebuilder_video_url_property">
4847
<data key="name">Video URL</data>
4948
<data key="section">general</data>
5049
<data key="fieldName">video_source</data>
51-
<data key="value">https://www.youtube.com/watch?v=slOtnjsbff0</data>
52-
<data key="renderedValue">https://www.youtube.com/embed/slOtnjsbff0</data>
50+
<data key="value"/>
51+
<data key="tooltipText">Video URLs can be links to videos on YouTube or Vimeo, or HTTP(S) links to files with valid video extensions (we recommend .mp4)</data>
5352
</entity>
5453
<entity name="PageBuilderVideoUrl_YouTube_Insecure" type="pagebuilder_video_url_property">
5554
<data key="name">Video URL</data>
@@ -85,23 +84,17 @@
8584
<data key="fieldName">video_source</data>
8685
<data key="value">https://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
8786
<data key="renderedValue">https://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
88-
<data key="width">320px</data>
89-
<data key="height">320px</data>
9087
</entity>
9188
<entity name="PageBuilderVideoUrl_Mp4_URL_Insecure" type="pagebuilder_video_url_property">
9289
<data key="name">Video URL</data>
9390
<data key="section">general</data>
9491
<data key="fieldName">video_source</data>
9592
<data key="value">http://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
9693
<data key="renderedValue">http://obsessive-owls.s3.us-east-2.amazonaws.com/MFTF/avocado.mp4</data>
94+
<data key="width">320px</data>
95+
<data key="height">320px</data>
9796
</entity>
9897
<!-- Width -->
99-
<entity name="PageBuilderVideoWidth_Empty" type="pagebuilder_video_width_property">
100-
<data key="name">Maximum Width</data>
101-
<data key="section">general</data>
102-
<data key="fieldName">max_width</data>
103-
<data key="value"/>
104-
</entity>
10598
<entity name="PageBuilderVideoWidth_500" type="pagebuilder_video_width_property">
10699
<data key="name">Maximum Width</data>
107100
<data key="section">general</data>

0 commit comments

Comments
 (0)