Skip to content

Commit 03ded0b

Browse files
committed
Merge branch 'develop' of https://github.com/magento-l3/magento2-page-builder into ACP2E-1954
2 parents b0afba5 + 4d8333b commit 03ded0b

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ValidateFullScreenVideoHasPlaysinlineAttributeActionGroup">
11+
<executeJS function="return document.querySelectorAll('{{VideoOnStorefront.mainCSS}} {{VideoOnStorefront.videoWithPlaysinline}}').length" stepKey="playsinlineAttributesCount"/>
12+
<assertEquals stepKey="assertPlaysinlineAttributePresent">
13+
<expectedResult type="string">1</expectedResult>
14+
<actualResult type="variable">playsinlineAttributesCount</actualResult>
15+
</assertEquals>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderVideoSection/VideoOnStorefrontSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="VideoOnStorefront">
1111
<element name="allVideo" type="text" selector="[data-content-type='video']"/>
12+
<element name="videoWithPlaysinline" type="text" selector="video[playsinline=true]"/>
1213
<element name="mainCSS" type="text" selector="[data-content-type=video][data-element=main]"/>
1314
<element name="wrapperCSS" type="text" selector="[data-content-type=video] [data-element=wrapper]"/>
1415
<element name="main" type="text" selector="(//div[@data-content-type=&quot;video&quot;])[{{arg1}}]" parameterized="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="VideoValidateAutoplayPlaysinlineMp4Enabled">
11+
<annotations>
12+
<features value="PageBuilder"/>
13+
<stories value="Video"/>
14+
<title value="Validate Video Playsinline Autoplay Attribute"/>
15+
<description value="Validate that setting the autoplay attribute in the General form for Video will also add the playsinline attribute to the video tag in order for autoplay to work on mobile Safari browser"/>
16+
<severity value="AVERAGE"/>
17+
<useCaseId value="ACP2E-1654"/>
18+
<testCaseId value="AC-8149"/>
19+
<group value="pagebuilder"/>
20+
<group value="pagebuilder-video"/>
21+
</annotations>
22+
<before>
23+
<createData entity="_emptyCmsPage" stepKey="createCMSPage"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
29+
</after>
30+
31+
<!-- Add an autoplay video to the CMS page -->
32+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage">
33+
<argument name="CMSPage" value="$$createCMSPage$$"/>
34+
</actionGroup>
35+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
36+
<actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer">
37+
<argument name="contentType" value="PageBuilderRowContentType"/>
38+
<argument name="containerTargetType" value="PageBuilderRootContainerContentType"/>
39+
</actionGroup>
40+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
41+
<argument name="contentType" value="PageBuilderVideoContentType"/>
42+
</actionGroup>
43+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection">
44+
<argument name="contentType" value="PageBuilderVideoContentType"/>
45+
</actionGroup>
46+
<actionGroup ref="dragContentTypeToStage" stepKey="dragVideoIntoStage">
47+
<argument name="contentType" value="PageBuilderVideoContentType"/>
48+
</actionGroup>
49+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop">
50+
<argument name="contentType" value="PageBuilderVideoContentType"/>
51+
</actionGroup>
52+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterVideoUrlProperty">
53+
<argument name="property" value="PageBuilderVideoUrl_Mp4_URL"/>
54+
</actionGroup>
55+
<actionGroup ref="conditionalClickSlideOutPanelFieldGeneral" stepKey="setAutoplayEnabled">
56+
<argument name="property" value="PageBuilderVideoAutoplay_Enabled"/>
57+
</actionGroup>
58+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
59+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/>
60+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/>
61+
62+
<!-- Validate that the added autoplay video will have playsinline tag at the storefront -->
63+
<actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToCMSPageStorefront">
64+
<argument name="page" value="$$createCMSPage.identifier$$"/>
65+
</actionGroup>
66+
<actionGroup ref="ValidateFullScreenVideoHasPlaysinlineAttributeActionGroup" stepKey="validateVideoPlaysinlineAttribute"/>
67+
</test>
68+
</tests>

app/code/Magento/PageBuilder/view/adminhtml/pagebuilder/content_type/video.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<attribute name="video_source" source="src" converter="Magento_PageBuilder/js/content-type/video/converter/attribute/videosrc" preview_converter="Magento_PageBuilder/js/content-type/video/converter/attribute/videosrc"/>
4747
<attribute name="autoplay" storage_key="autoplay" source="autoplay" converter="Magento_PageBuilder/js/content-type/video/converter/attribute/autoplay"/>
4848
<attribute name="muted_video" storage_key="autoplay" source="muted" converter="Magento_PageBuilder/js/content-type/video/converter/attribute/autoplay"/>
49+
<attribute name="playsinline_video" storage_key="autoplay" source="playsinline" converter="Magento_PageBuilder/js/content-type/video/converter/attribute/autoplay"/>
4950
</element>
5051
</elements>
5152
</appearance>

0 commit comments

Comments
 (0)