aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-25 11:41:29 +0200
committerChocobozzz <me@florianbigard.com>2023-05-25 11:41:29 +0200
commita41b944398af03ad7594380ad1cb7a978f6417cb (patch)
treeb90c6304143463233f477a4511afa67485f17fa3 /client/e2e
parent22b34b2d7570392a5623cc6aa97a935a03399591 (diff)
downloadPeerTube-a41b944398af03ad7594380ad1cb7a978f6417cb.tar.gz
PeerTube-a41b944398af03ad7594380ad1cb7a978f6417cb.tar.zst
PeerTube-a41b944398af03ad7594380ad1cb7a978f6417cb.zip
Fix local e2e tests
Diffstat (limited to 'client/e2e')
-rw-r--r--client/e2e/src/po/admin-config.po.ts2
-rw-r--r--client/e2e/src/po/my-account.po.ts6
-rw-r--r--client/e2e/src/po/signup.po.ts2
-rw-r--r--client/e2e/src/suites-local/signup.e2e-spec.ts4
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 {
17 const elem = $('#instanceDefaultNSFWPolicy') 17 const elem = $('#instanceDefaultNSFWPolicy')
18 18
19 await elem.waitForDisplayed() 19 await elem.waitForDisplayed()
20 await elem.scrollIntoView(false) // Avoid issues with fixed header on firefox 20 await elem.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header
21 await elem.waitForClickable() 21 await elem.waitForClickable()
22 22
23 return elem.selectByAttribute('value', newValue) 23 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 {
24 const nsfw = $('#nsfwPolicy') 24 const nsfw = $('#nsfwPolicy')
25 25
26 await nsfw.waitForDisplayed() 26 await nsfw.waitForDisplayed()
27 await nsfw.scrollIntoView(false) // Avoid issues with fixed header on firefox 27 await nsfw.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header
28 await nsfw.waitForClickable() 28 await nsfw.waitForClickable()
29 29
30 await nsfw.selectByAttribute('value', newValue) 30 await nsfw.selectByAttribute('value', newValue)
@@ -36,7 +36,7 @@ export class MyAccountPage {
36 const p2p = await getCheckbox('p2pEnabled') 36 const p2p = await getCheckbox('p2pEnabled')
37 37
38 await p2p.waitForClickable() 38 await p2p.waitForClickable()
39 await p2p.scrollIntoView(false) // Avoid issues with fixed header on firefox 39 await p2p.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header
40 40
41 await p2p.click() 41 await p2p.click()
42 42
@@ -47,7 +47,7 @@ export class MyAccountPage {
47 const submit = $('my-user-video-settings input[type=submit]') 47 const submit = $('my-user-video-settings input[type=submit]')
48 48
49 await submit.waitForClickable() 49 await submit.waitForClickable()
50 await submit.scrollIntoView(false) 50 await submit.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header
51 await submit.click() 51 await submit.click()
52 } 52 }
53 53
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 {
50 await $('#password').setValue(options.password || 'password') 50 await $('#password').setValue(options.password || 'password')
51 51
52 // Fix weird bug on firefox that "cannot scroll into view" when using just `setValue` 52 // Fix weird bug on firefox that "cannot scroll into view" when using just `setValue`
53 await $('#email').scrollIntoView(false) 53 await $('#email').scrollIntoView({ block: 'center' })
54 await $('#email').waitForClickable() 54 await $('#email').waitForClickable()
55 await $('#email').setValue(options.email || `${options.username}@example.com`) 55 await $('#email').setValue(options.email || `${options.username}@example.com`)
56 } 56 }
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', () => {
243 let emailPort: number 243 let emailPort: number
244 244
245 before(async () => { 245 before(async () => {
246 const key = browser.options.baseUrl + '-emailPort'
246 // FIXME: typings are wrong, get returns a promise 247 // FIXME: typings are wrong, get returns a promise
247 emailPort = await (browser.sharedStore.get(browser.options.baseUrl + '-emailPort') as unknown as Promise<number>) 248 // FIXME: use * because the key is not properly escaped by the shared store when using get(key)
249 emailPort = (await (browser.sharedStore.get('*') as unknown as Promise<number>))[key]
248 250
249 await MockSMTPServer.Instance.collectEmails(emailPort, emails) 251 await MockSMTPServer.Instance.collectEmails(emailPort, emails)
250 }) 252 })