From a41b944398af03ad7594380ad1cb7a978f6417cb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 25 May 2023 11:41:29 +0200 Subject: [PATCH] Fix local e2e tests --- client/e2e/src/po/admin-config.po.ts | 2 +- client/e2e/src/po/my-account.po.ts | 6 +++--- client/e2e/src/po/signup.po.ts | 2 +- client/e2e/src/suites-local/signup.e2e-spec.ts | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/e2e/src/po/admin-config.po.ts b/client/e2e/src/po/admin-config.po.ts index 510037ddd..3cf9b17d9 100644 --- a/client/e2e/src/po/admin-config.po.ts +++ b/client/e2e/src/po/admin-config.po.ts @@ -17,7 +17,7 @@ export class AdminConfigPage { const elem = $('#instanceDefaultNSFWPolicy') await elem.waitForDisplayed() - await elem.scrollIntoView(false) // Avoid issues with fixed header on firefox + await elem.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header await elem.waitForClickable() return elem.selectByAttribute('value', newValue) diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts index 222dbb569..5188eca11 100644 --- a/client/e2e/src/po/my-account.po.ts +++ b/client/e2e/src/po/my-account.po.ts @@ -24,7 +24,7 @@ export class MyAccountPage { const nsfw = $('#nsfwPolicy') await nsfw.waitForDisplayed() - await nsfw.scrollIntoView(false) // Avoid issues with fixed header on firefox + await nsfw.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header await nsfw.waitForClickable() await nsfw.selectByAttribute('value', newValue) @@ -36,7 +36,7 @@ export class MyAccountPage { const p2p = await getCheckbox('p2pEnabled') await p2p.waitForClickable() - await p2p.scrollIntoView(false) // Avoid issues with fixed header on firefox + await p2p.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header await p2p.click() @@ -47,7 +47,7 @@ export class MyAccountPage { const submit = $('my-user-video-settings input[type=submit]') await submit.waitForClickable() - await submit.scrollIntoView(false) + await submit.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header await submit.click() } diff --git a/client/e2e/src/po/signup.po.ts b/client/e2e/src/po/signup.po.ts index 7917cdda7..84a7a1847 100644 --- a/client/e2e/src/po/signup.po.ts +++ b/client/e2e/src/po/signup.po.ts @@ -50,7 +50,7 @@ export class SignupPage { await $('#password').setValue(options.password || 'password') // Fix weird bug on firefox that "cannot scroll into view" when using just `setValue` - await $('#email').scrollIntoView(false) + await $('#email').scrollIntoView({ block: 'center' }) await $('#email').waitForClickable() await $('#email').setValue(options.email || `${options.username}@example.com`) } diff --git a/client/e2e/src/suites-local/signup.e2e-spec.ts b/client/e2e/src/suites-local/signup.e2e-spec.ts index aaf5683f1..98dc469c9 100644 --- a/client/e2e/src/suites-local/signup.e2e-spec.ts +++ b/client/e2e/src/suites-local/signup.e2e-spec.ts @@ -243,8 +243,10 @@ describe('Signup', () => { let emailPort: number before(async () => { + const key = browser.options.baseUrl + '-emailPort' // FIXME: typings are wrong, get returns a promise - emailPort = await (browser.sharedStore.get(browser.options.baseUrl + '-emailPort') as unknown as Promise) + // FIXME: use * because the key is not properly escaped by the shared store when using get(key) + emailPort = (await (browser.sharedStore.get('*') as unknown as Promise))[key] await MockSMTPServer.Instance.collectEmails(emailPort, emails) })