Skip to content

Commit 456176c

Browse files
committed
Merge branch 'BUG#AC-7092' of https://github.com/magento-gl/magento2ce into spartans_pr_18042023
2 parents e6e2dc3 + e72e35b commit 456176c

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontProductVideoAutoplayOnGalleryFullscreenModeTest">
12+
<annotations>
13+
<features value="ProductVideo"/>
14+
<stories value="Storefront product video autoplay on gallery full screen mode"/>
15+
<title value="Storefront product video gets auto played on gallery full screen mode"/>
16+
<description value="Storefront product video autoplay on selecting the video by clicking video thumbnail in
17+
gallery full screen mode"/>
18+
<severity value="MAJOR"/>
19+
<group value="productVideo"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
23+
<!-- Login to Admin page -->
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
28+
<!-- Logout from Admin page -->
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
</after>
31+
<!-- Open product edit page -->
32+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
33+
<argument name="productId" value="$createProduct.id$"/>
34+
</actionGroup>
35+
<!-- Add image to product -->
36+
<actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct">
37+
<argument name="image" value="MagentoLogo"/>
38+
</actionGroup>
39+
<!-- Add product video -->
40+
<actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo">
41+
<argument name="video" value="VimeoProductVideo"/>
42+
</actionGroup>
43+
<!-- Save product form -->
44+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
45+
<!-- Open storefront product page -->
46+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefrontProductPage">
47+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
48+
</actionGroup>
49+
<actionGroup ref="StorefrontProductPageOpenImageFullscreenActionGroup" stepKey="openGalleryFullScreen">
50+
<argument name="imageNumber" value="1"/>
51+
</actionGroup>
52+
<conditionalClick selector="{{StorefrontProductMediaSection.fotoramaImageThumbnail('2')}}"
53+
dependentSelector="{{StorefrontProductMediaSection.fotoramaImageThumbnailActive('2')}}"
54+
visible="false" stepKey="clickOnVideoThumbnail"/>
55+
<wait stepKey="waitTenSecondsToPlayVideo" time="10"/>
56+
<!-- On clicking video thumbnail, assert the video iframe is loaded with autoplay attribute -->
57+
<seeElementInDOM selector="iframe" stepKey="AssertVideoIsPlayed"/>
58+
<grabAttributeFrom selector="iframe" userInput="allow" stepKey="grabAllowAttribute"/>
59+
<assertStringContainsString stepKey="assertAllowAttribute">
60+
<actualResult type="string">$grabAllowAttribute</actualResult>
61+
<expectedResult type="string">autoplay</expectedResult>
62+
</assertStringContainsString>
63+
<actionGroup ref="StorefrontProductPageCloseFullscreenGalleryActionGroup" stepKey="closeGalleryFullScreen"/>
64+
</test>
65+
</tests>

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ define([
558558
}
559559

560560
if (this.isFullscreen && this.fotoramaItem.data('fotorama').activeFrame.i === number) {
561-
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
561+
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame.trigger('click');
562562
}
563563
},
564564

@@ -700,7 +700,7 @@ define([
700700
if (activeIndexIsBase && number === 1 && $(window).width() > this.MobileMaxWidth) {
701701
setTimeout($.proxy(function () {
702702
fotorama.requestFullScreen();
703-
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
703+
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame.trigger('click');
704704
this.Base = false;
705705
}, this), 50);
706706
}

0 commit comments

Comments
 (0)