From 29fc2db3a2addd496143075b808583cf6cd09e73 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Mar 2024 14:19:11 +0100 Subject: [PATCH] Fix E2E tests --- client/e2e/src/po/player.po.ts | 8 +++++++- client/e2e/wdio.browserstack.conf.ts | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/e2e/src/po/player.po.ts b/client/e2e/src/po/player.po.ts index b53976ebc..d3744a43c 100644 --- a/client/e2e/src/po/player.po.ts +++ b/client/e2e/src/po/player.po.ts @@ -49,7 +49,13 @@ export class PlayerPage { async playVideo () { await $('div.video-js.vjs-paused, div.video-js.vjs-playing').waitForExist() - if (await $('div.video-js.vjs-playing').isExisting()) return + if (await $('div.video-js.vjs-playing').isExisting()) { + if (!isIOS()) return + + // On iOS, the web browser may have aborted player autoplay, so check the video is still autoplayed + await browserSleep(5000) + if (await $('div.video-js.vjs-playing').isExisting()) return + } // Autoplay is disabled on iOS and Safari if (isIOS() || isSafari() || isMobileDevice()) { diff --git a/client/e2e/wdio.browserstack.conf.ts b/client/e2e/wdio.browserstack.conf.ts index ecab74078..074a393aa 100644 --- a/client/e2e/wdio.browserstack.conf.ts +++ b/client/e2e/wdio.browserstack.conf.ts @@ -10,7 +10,7 @@ if (!key) throw new Error('Miss browser stack key') function buildMainOptions (sessionName: string) { return { projectName: 'PeerTube', - buildName: 'Main E2E - ' + new Date().toISOString().split('T')[0], + buildName: 'Main E2E - ' + new Date().toISOString(), sessionName, consoleLogs: 'info', networkLogs: true @@ -100,7 +100,7 @@ module.exports = { { browserName: 'Safari', - ...buildBStackMobileOptions({ sessionName: 'Safari iPhone', deviceName: 'iPhone 8 Plus', osVersion: '12.4' }) + ...buildBStackMobileOptions({ sessionName: 'Safari iPhone', deviceName: 'iPhone 8', osVersion: '13' }) }, { browserName: 'Safari',