From 0b43929f4dd09cdc9b699c4615ee7977ef7c62bc Mon Sep 17 00:00:00 2001 From: powerivq Date: Fri, 4 Oct 2024 22:14:55 +0800 Subject: [PATCH] WIP Reenable flaky video test --- test/integration/test-video-players-helper.js | 13 +- test/integration/test-video-players.js | 225 +++++++++--------- 2 files changed, 117 insertions(+), 121 deletions(-) diff --git a/test/integration/test-video-players-helper.js b/test/integration/test-video-players-helper.js index e31678359f51..80a01ee87380 100644 --- a/test/integration/test-video-players-helper.js +++ b/test/integration/test-video-players-helper.js @@ -179,8 +179,7 @@ export function runVideoPlayerIntegrationTests( }); }); - // TODO(#40115): fix this flaky test - it.skip('should trigger pause analytics when the video pauses', function () { + it('should trigger pause analytics when the video pauses', function () { let pauseButton; return getVideoPlayer({ @@ -202,8 +201,7 @@ export function runVideoPlayerIntegrationTests( }); }); - // TODO(#40115): fix this flaky test - it.skip('should trigger session analytics when a session ends', function () { + it('should trigger session analytics when a session ends', function () { let pauseButton; return getVideoPlayer({ @@ -381,8 +379,7 @@ export function runVideoPlayerIntegrationTests( this.timeout(timeout); describe('play/pause', () => { - // TODO(#40115): fix this flaky test - it.skip('should play when in view port initially', () => { + it('should play when in view port initially', () => { return getVideoPlayer({outsideView: false, autoplay: true}).then( (r) => { return listenOncePromise(r.video, VideoEvents_Enum.PLAYING); @@ -593,8 +590,8 @@ export function runVideoPlayerIntegrationTests( video.setAttribute('id', 'myVideo'); video.setAttribute('controls', ''); video.setAttribute('layout', 'fixed'); - video.setAttribute('width', '300px'); - video.setAttribute('height', '50vh'); + video.setAttribute('width', '300'); + video.setAttribute('height', '50'); video.style.position = 'absolute'; video.style.top = top; diff --git a/test/integration/test-video-players.js b/test/integration/test-video-players.js index af88ec44bbb4..1048940a4e62 100644 --- a/test/integration/test-video-players.js +++ b/test/integration/test-video-players.js @@ -20,19 +20,19 @@ describes.sandboxed('amp-video', {}, (env) => { }); }); -describes.sandboxed('amp-video-iframe', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-video-iframe'); - video.setAttribute('src', '/examples/amp-video-iframe/frame.html'); - video.setAttribute('poster', 'https://placekitten.com/800/450'); - return video; - }, - null, - 20000 - ); -}); +// describes.sandboxed('amp-video-iframe', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-video-iframe'); +// video.setAttribute('src', '/examples/amp-video-iframe/frame.html'); +// video.setAttribute('poster', 'https://placekitten.com/800/450'); +// return video; +// }, +// null, +// 20000 +// ); +// }); describes.sandboxed('amp-youtube', {}, (env) => { runVideoPlayerIntegrationTests( @@ -47,109 +47,108 @@ describes.sandboxed('amp-youtube', {}, (env) => { ); }); -describes.sandboxed('amp-dailymotion', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-dailymotion'); - video.setAttribute('data-videoid', 'x3rdtfy'); - return video; - }, - null, - 20000 - ); -}); +// describes.sandboxed('amp-dailymotion', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-dailymotion'); +// video.setAttribute('data-videoid', 'x3rdtfy'); +// return video; +// }, +// null, +// 20000 +// ); +// }); -// TODO(#39857): Unskip when integration is fixed. -describes.sandboxed.skip('amp-3q-player', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-3q-player'); - video.setAttribute('data-id', 'c8dbe7f4-7f7f-11e6-a407-0cc47a188158'); - return video; - }, - null, - 20000 - ); -}); +// describes.sandboxed('amp-3q-player', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-3q-player'); +// video.setAttribute('data-id', 'c8dbe7f4-7f7f-11e6-a407-0cc47a188158'); +// return video; +// }, +// null, +// 20000 +// ); +// }); -//TODO(aghassemi,#8264): Unskip when integration is fixed. -describes.sandboxed.skip('amp-nexxtv-player', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-nexxtv-player'); - video.setAttribute('data-mediaid', 'PTPFEC4U184674'); - video.setAttribute('data-client', '583'); - return video; - }, - null, - 20000 - ); -}); +// //TODO(aghassemi,#8264): Unskip when integration is fixed. +// describes.sandboxed.skip('amp-nexxtv-player', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-nexxtv-player'); +// video.setAttribute('data-mediaid', 'PTPFEC4U184674'); +// video.setAttribute('data-client', '583'); +// return video; +// }, +// null, +// 20000 +// ); +// }); -describes.sandboxed('amp-ima-video', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-ima-video'); - video.setAttribute('width', 640); - video.setAttribute('height', 360); - video.setAttribute('data-width', '640'); - video.setAttribute('data-height', '360'); - video.setAttribute('data-src', '/examples/av/ForBiggerJoyrides-tiny.mp4'); - video.setAttribute( - 'data-tag', - 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=' - ); - video.setAttribute('data-poster', '/examples/img/ima-poster.png'); - return video; - }, - 'amp-ima-video', - 20000 - ); -}); +// describes.sandboxed('amp-ima-video', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-ima-video'); +// video.setAttribute('width', 640); +// video.setAttribute('height', 360); +// video.setAttribute('data-width', '640'); +// video.setAttribute('data-height', '360'); +// video.setAttribute('data-src', '/examples/av/ForBiggerJoyrides-tiny.mp4'); +// video.setAttribute( +// 'data-tag', +// 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=' +// ); +// video.setAttribute('data-poster', '/examples/img/ima-poster.png'); +// return video; +// }, +// 'amp-ima-video', +// 20000 +// ); +// }); -describes.sandboxed('amp-brid-player', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-brid-player'); - video.setAttribute('data-partner', '264'); - video.setAttribute('data-player', '4144'); - video.setAttribute('data-video', '13663'); - return video; - }, - null, - 20000 - ); -}); +// describes.sandboxed('amp-brid-player', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-brid-player'); +// video.setAttribute('data-partner', '264'); +// video.setAttribute('data-player', '4144'); +// video.setAttribute('data-video', '13663'); +// return video; +// }, +// null, +// 20000 +// ); +// }); -describes.sandboxed.skip('amp-brightcove', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-brightcove'); - video.setAttribute('data-account-id', '1290862519001'); - video.setAttribute('data-player-id', 'SyIOV8yWM'); - video.setAttribute('data-video-id', 'amp-test-video'); - return video; - }, - null, - 20000 - ); -}); +// describes.sandboxed.skip('amp-brightcove', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-brightcove'); +// video.setAttribute('data-account-id', '1290862519001'); +// video.setAttribute('data-player-id', 'SyIOV8yWM'); +// video.setAttribute('data-video-id', 'amp-test-video'); +// return video; +// }, +// null, +// 20000 +// ); +// }); -describes.sandboxed.skip('amp-delight-player', {}, (env) => { - runVideoPlayerIntegrationTests( - env, - (fixture) => { - const video = fixture.doc.createElement('amp-delight-player'); - video.setAttribute('data-content-id', '-LLoCCZqWi18O73b6M0w'); - return video; - }, - null, - 20000 - ); -}); +// describes.sandboxed.skip('amp-delight-player', {}, (env) => { +// runVideoPlayerIntegrationTests( +// env, +// (fixture) => { +// const video = fixture.doc.createElement('amp-delight-player'); +// video.setAttribute('data-content-id', '-LLoCCZqWi18O73b6M0w'); +// return video; +// }, +// null, +// 20000 +// ); +// });