Skip to content

Commit

Permalink
Skip Safari on flaky video test (#10270)
Browse files Browse the repository at this point in the history
* skip safari for flaky video test

* fix lint
  • Loading branch information
William Chou committed Jul 6, 2017
1 parent 2391bbd commit 736045c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/integration/test-video-players-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ export function runVideoPlayerIntegrationTests(

describe.configure().retryOnSaucelabs().run('Autoplay', function() {
this.timeout(TIMEOUT);

describe('play/pause', () => {
it('should play when in view port initially', () => {
return getVideoPlayer({outsideView: false, autoplay: true}).then(r => {
Expand All @@ -315,7 +316,9 @@ export function runVideoPlayerIntegrationTests(
});
});

it('should play/pause when video enters/exists viewport', () => {
// TODO(aghassemi, #9379): Flaky on Safari 9.
it.configure().skipSafari().run('should play/pause when video ' +
'enters/exits viewport', () => {
let video;
let viewport;
return getVideoPlayer({outsideView: true, autoplay: true}).then(r => {
Expand All @@ -336,7 +339,7 @@ export function runVideoPlayerIntegrationTests(
});

describe('Animated Icon', () => {
// TODO(amphtml): Unskip when #8385 is fixed.
// TODO(amphtml): Unskip when #9379 is fixed.
it.skip('should create an animated icon overlay', () => {
let video;
let viewport;
Expand Down Expand Up @@ -364,14 +367,12 @@ export function runVideoPlayerIntegrationTests(
function isAnimationPaused(iconElement) {
const animElement = iconElement.querySelector('.amp-video-eq-1-1');
const win = iconElement.ownerDocument.defaultView;
const computedStyle = win.getComputedStyle(animElement);
const cs = win.getComputedStyle(animElement);
const isPaused =
(computedStyle.getPropertyValue('animation-play-state') == 'paused'
|| computedStyle.getPropertyValue('-webkit-animation-play-state') ==
'paused'
|| computedStyle.getPropertyValue('animation-name') == 'none'
|| computedStyle.getPropertyValue('-webkit-animation-name') ==
'none');
cs.getPropertyValue('animation-play-state') == 'paused' ||
cs.getPropertyValue('-webkit-animation-play-state') == 'paused' ||
cs.getPropertyValue('animation-name') == 'none' ||
cs.getPropertyValue('-webkit-animation-name') == 'none';
return isPaused;
}

Expand Down Expand Up @@ -439,7 +440,7 @@ export function runVideoPlayerIntegrationTests(
videoGlobal = video;
return poll('video built', () => {
return video.implementation_ && video.implementation_.play;
},undefined, 5000).then(() => {
}, /* opt_onError */ undefined, /* opt_timeout */ 5000).then(() => {
return {video, fixture};
});
});
Expand Down

0 comments on commit 736045c

Please sign in to comment.