Skip to content

Commit 563488e

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-91707' into EPAM-PR-19
2 parents 47af6c6 + c5bf873 commit 563488e

File tree

3 files changed

+106
-7
lines changed

3 files changed

+106
-7
lines changed

app/code/Magento/ProductVideo/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductInfoMainSection">
1212
<element name="productVideo" type="text" selector="//*[@class='product-video' and @data-type='{{videoType}}']" parameterized="true"/>
13+
<element name="clickInVideo" type="video" selector="//*[@class='fotorama__stage__shaft']"/>
14+
<element name="videoPausedMode" type="video" selector="//*[contains(@class, 'paused-mode')]"/>
15+
<element name="videoPlayedMode" type="video" selector="//*[contains(@class,'playing-mode')]"/>
16+
<element name="frameVideo" type="video" selector="widget2"/>
1317
</section>
1418
</sections>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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="YoutubeVideoWindowOnProductPageTest">
12+
<annotations>
13+
<features value="ProductVideo"/>
14+
<stories value="MAGETWO-91707: [Sigma Beauty]Cannot pause Youtube video in IE 11"/>
15+
<testCaseId value="MAGETWO-95254"/>
16+
<title value="Youtube video window on the product page"/>
17+
<description value="Check Youtube video window on the product page"/>
18+
<severity value="MAJOR"/>
19+
<group value="ProductVideo"/>
20+
</annotations>
21+
22+
<before>
23+
<!--Log In-->
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
<!--Create category-->
26+
<createData entity="_defaultCategory" stepKey="createCategory"/>
27+
<!--Create product-->
28+
<createData entity="SimpleProduct" stepKey="createProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
<!-- Set product video Youtube api key configuration -->
32+
<createData entity="ProductVideoYoutubeApiKeyConfig" stepKey="setStoreConfig" after="loginAsAdmin"/>
33+
</before>
34+
35+
<!--Open simple product-->
36+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/>
37+
<waitForPageLoad stepKey="wait1"/>
38+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/>
39+
<actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku">
40+
<argument name="product" value="$$createProduct$$"/>
41+
</actionGroup>
42+
<actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/>
43+
44+
<!-- Add product video -->
45+
<actionGroup ref="addProductVideo" stepKey="addProductVideo" after="openFirstProductForEdit"/>
46+
<!-- Assert product video in admin product form -->
47+
<actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="addProductVideo"/>
48+
49+
<!-- Save the product -->
50+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveFirstProduct"/>
51+
<waitForPageLoad stepKey="waitForFirstProductSaved"/>
52+
53+
<!-- Assert product video in storefront product page -->
54+
<amOnPage url="$$createProduct.name$$.html" stepKey="goToStorefrontCategoryPage"/>
55+
<waitForPageLoad stepKey="waitForStorefrontPageLoaded"/>
56+
<actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/>
57+
58+
<!--Click Play video button-->
59+
<click stepKey="clickToPlayVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/>
60+
<wait stepKey="waitFiveSecondToPlayVideo" time="5"/>
61+
<switchToIFrame selector="{{StorefrontProductInfoMainSection.frameVideo}}" stepKey="switchToFrame"/>
62+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="waitForVideoPlayed"/>
63+
<seeElement selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="AssertVideoIsPlayed"/>
64+
<switchToIFrame stepKey="switchBack1"/>
65+
66+
<!--Click Pause button-->
67+
<click stepKey="clickToStopVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/>
68+
<wait stepKey="waitFiveSecondToStopVideo" time="5"/>
69+
<switchToIFrame selector="{{StorefrontProductInfoMainSection.frameVideo}}" stepKey="switchToFrame2"/>
70+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.videoPausedMode}}" stepKey="waitForVideoPaused"/>
71+
<seeElement selector="{{StorefrontProductInfoMainSection.videoPausedMode}}" stepKey="AssertVideoIsPaused"/>
72+
<switchToIFrame stepKey="switchBack2"/>
73+
74+
<!--Click Play video button again. Make sure that Video continued playing-->
75+
<click stepKey="clickAgainToPlayVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/>
76+
<wait stepKey="waitAgainFiveSecondToPlayVideo" time="5"/>
77+
<switchToIFrame selector="{{StorefrontProductInfoMainSection.frameVideo}}" stepKey="switchToFrame3"/>
78+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="waitForVideoPlayedAgain"/>
79+
<seeElement selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="AssertVideoIsPlayedAgain"/>
80+
<switchToIFrame stepKey="switchBack3"/>
81+
82+
<after>
83+
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
84+
<deleteData createDataKey="createCategory" stepKey="deleteCategoryFirst"/>
85+
<!-- Set product video configuration to default -->
86+
<createData entity="DefaultProductVideoConfig" stepKey="setStoreDefaultConfig" before="logout"/>
87+
<!--Log Out-->
88+
<actionGroup ref="logout" stepKey="logout"/>
89+
</after>
90+
</test>
91+
</tests>
92+

lib/web/fotorama/fotorama.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,11 +2487,11 @@ fotoramaVersion = '4.6.4';
24872487
.append($videoPlay.clone());
24882488

24892489
// This solves tabbing problems
2490-
addFocus(frame, function () {
2490+
addFocus(frame, function (e) {
24912491
setTimeout(function () {
24922492
lockScroll($stage);
24932493
}, 0);
2494-
clickToShow({index: frameData.eq, user: true});
2494+
clickToShow({index: frameData.eq, user: true}, e);
24952495
});
24962496

24972497
$stageFrame = $stageFrame.add($frame);
@@ -3040,7 +3040,10 @@ fotoramaVersion = '4.6.4';
30403040
return time;
30413041
}
30423042

3043-
that.showStage = function (silent, options, time) {
3043+
that.showStage = function (silent, options, time, e) {
3044+
if (e !== undefined && e.target.tagName == 'IFRAME') {
3045+
return;
3046+
}
30443047
unloadVideo($videoPlaying, activeFrame.i !== data[normalizeIndex(repositionIndex)].i);
30453048
frameDraw(activeIndexes, 'stage');
30463049
stageFramePosition(SLOW ? [dirtyIndex] : [dirtyIndex, getPrevIndex(dirtyIndex), getNextIndex(dirtyIndex)]);
@@ -3128,7 +3131,7 @@ fotoramaVersion = '4.6.4';
31283131
}
31293132
};
31303133

3131-
that.show = function (options) {
3134+
that.show = function (options, e) {
31323135
that.longPress.singlePressInProgress = true;
31333136

31343137
var index = calcActiveIndex(options);
@@ -3139,7 +3142,7 @@ fotoramaVersion = '4.6.4';
31393142

31403143
var silent = _activeFrame === activeFrame && !options.user;
31413144

3142-
that.showStage(silent, options, time);
3145+
that.showStage(silent, options, time, e);
31433146
that.showNav(silent, options, time);
31443147

31453148
showedFLAG = typeof lastActiveIndex !== 'undefined' && lastActiveIndex !== activeIndex;
@@ -3499,7 +3502,7 @@ fotoramaVersion = '4.6.4';
34993502

35003503
$stage.on('mousemove', stageCursor);
35013504

3502-
function clickToShow(showOptions) {
3505+
function clickToShow(showOptions, e) {
35033506
clearTimeout(clickToShow.t);
35043507

35053508
if (opts.clicktransition && opts.clicktransition !== opts.transition) {
@@ -3516,7 +3519,7 @@ fotoramaVersion = '4.6.4';
35163519
}, 10);
35173520
}, 0);
35183521
} else {
3519-
that.show(showOptions);
3522+
that.show(showOptions, e);
35203523
}
35213524
}
35223525

0 commit comments

Comments
 (0)