From 101dd3b1207782423b6c179dc89d62cad0bd17e9 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 27 Jul 2020 13:56:43 -0700 Subject: [PATCH] fix(test): make video test pass on Mac (#3121) --- test/capabilities.jest.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/capabilities.jest.js b/test/capabilities.jest.js index f4b336b093f32..238b4387cb9c9 100644 --- a/test/capabilities.jest.js +++ b/test/capabilities.jest.js @@ -14,7 +14,9 @@ * limitations under the License. */ -const {FFOX, CHROMIUM, WEBKIT, WIN, LINUX} = testOptions; +const path = require('path'); + +const {FFOX, CHROMIUM, WEBKIT, WIN, LINUX, ASSETS_DIR} = testOptions; describe('Capabilities', function() { it.fail(WEBKIT && WIN)('Web Assembly should work', async function({page, server}) { @@ -47,8 +49,16 @@ describe('Capabilities', function() { await page.goto(server.EMPTY_PAGE); expect(await page.evaluate(() => window.testStatus)).toBe('SUCCESS'); }); - it.fail(WEBKIT && !LINUX)('should play video', async({page, server}) => { - await page.goto(server.PREFIX + '/video.html'); + it.fail(WEBKIT && WIN)('should play video', async({page}) => { + // TODO: the test passes on Windows locally but fails on GitHub Action bot, + // apparently due to a Media Pack issue in the Windows Server. + // + // Our test server doesn't support range requests required to play on Mac, + // so we load the page using a file url. + const url = WIN + ? 'file:///' + path.join(ASSETS_DIR, 'video.html').replace(/\\/g, '/') + : 'file://' + path.join(ASSETS_DIR, 'video.html'); + await page.goto(url); await page.$eval('video', v => v.play()); await page.$eval('video', v => v.pause()); });