From 96bb9de7d0ec263ab8f93918ea1d61568be73acf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 6 Nov 2023 08:56:56 +0100 Subject: [PATCH] Fix E2E tests --- client/e2e/src/po/player.po.ts | 4 +++- client/e2e/src/utils/common.ts | 1 - client/e2e/wdio.main.conf.ts | 4 ++-- client/src/environments/environment.e2e.ts | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/e2e/src/po/player.po.ts b/client/e2e/src/po/player.po.ts index 881380bb5..b53976ebc 100644 --- a/client/e2e/src/po/player.po.ts +++ b/client/e2e/src/po/player.po.ts @@ -47,7 +47,9 @@ export class PlayerPage { } async playVideo () { - await $('div.video-js.vjs-paused').waitForExist() + await $('div.video-js.vjs-paused, div.video-js.vjs-playing').waitForExist() + + 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/src/utils/common.ts b/client/e2e/src/utils/common.ts index b04fe47f3..cfcf0ae6e 100644 --- a/client/e2e/src/utils/common.ts +++ b/client/e2e/src/utils/common.ts @@ -26,7 +26,6 @@ function isIOS () { async function go (url: string) { await browser.url(url) - // Hide notifications that could fail tests when hiding buttons await browser.execute(() => { const style = document.createElement('style') style.innerHTML = 'p-toast { display: none }' diff --git a/client/e2e/wdio.main.conf.ts b/client/e2e/wdio.main.conf.ts index 8e6ef51cf..79dce21c4 100644 --- a/client/e2e/wdio.main.conf.ts +++ b/client/e2e/wdio.main.conf.ts @@ -59,7 +59,7 @@ export const config = { // with `/`, the base url gets prepended, not including the path portion of your baseUrl. // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url // gets prepended directly. - baseUrl: 'http://localhost:9001', + baseUrl: 'http://127.0.0.1:9001', // // Default timeout for all waitFor* commands. waitforTimeout: 5000, @@ -80,7 +80,7 @@ export const config = { framework: 'mocha', // // The number of times to retry the entire specfile when it fails as a whole - specFileRetries: 1, + specFileRetries: 2, // // Delay in seconds between the spec file retry attempts // specFileRetriesDelay: 0, diff --git a/client/src/environments/environment.e2e.ts b/client/src/environments/environment.e2e.ts index a1a58e36f..f92ccaf0d 100644 --- a/client/src/environments/environment.e2e.ts +++ b/client/src/environments/environment.e2e.ts @@ -1,6 +1,6 @@ export const environment = { production: false, hmr: false, - apiUrl: 'http://localhost:9001', - originServerUrl: 'http://localhost:9001' + apiUrl: 'http://127.0.0.1:9001', + originServerUrl: 'http://127.0.0.1:9001' }