diff options
author | Chocobozzz <me@florianbigard.com> | 2021-09-03 10:27:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-09-03 16:35:18 +0200 |
commit | 6d210220be0875d63461829d83c6e3a59d05cf7a (patch) | |
tree | 60ec5b596ef06295b70ebb553920a39b549e0f13 /client/e2e/src/po/login.po.ts | |
parent | 2ede07153ce0282b116345dfee09bff902355a75 (diff) | |
download | PeerTube-6d210220be0875d63461829d83c6e3a59d05cf7a.tar.gz PeerTube-6d210220be0875d63461829d83c6e3a59d05cf7a.tar.zst PeerTube-6d210220be0875d63461829d83c6e3a59d05cf7a.zip |
Fix NSFW filter and add tests
Diffstat (limited to 'client/e2e/src/po/login.po.ts')
-rw-r--r-- | client/e2e/src/po/login.po.ts | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/client/e2e/src/po/login.po.ts b/client/e2e/src/po/login.po.ts index 8e3030e43..486b9a6d8 100644 --- a/client/e2e/src/po/login.po.ts +++ b/client/e2e/src/po/login.po.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { go } from '../utils' | 1 | import { go } from '../utils' |
2 | 2 | ||
3 | export class LoginPage { | 3 | export class LoginPage { |
4 | |||
4 | async loginAsRootUser () { | 5 | async loginAsRootUser () { |
5 | await go('/login') | 6 | await go('/login') |
6 | 7 | ||
@@ -8,7 +9,7 @@ export class LoginPage { | |||
8 | await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`) | 9 | await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`) |
9 | 10 | ||
10 | await $('input#username').setValue('root') | 11 | await $('input#username').setValue('root') |
11 | await $('input#password').setValue('test1') | 12 | await $('input#password').setValue('test' + this.getSuffix()) |
12 | 13 | ||
13 | await browser.pause(1000) | 14 | await browser.pause(1000) |
14 | 15 | ||
@@ -19,7 +20,24 @@ export class LoginPage { | |||
19 | await expect(this.getLoggedInInfoElem()).toHaveText('root') | 20 | await expect(this.getLoggedInInfoElem()).toHaveText('root') |
20 | } | 21 | } |
21 | 22 | ||
23 | async logout () { | ||
24 | await $('.logged-in-more').click() | ||
25 | |||
26 | const logout = () => $('.dropdown-item*=Log out') | ||
27 | |||
28 | await logout().waitForDisplayed() | ||
29 | await logout().click() | ||
30 | |||
31 | await $('.login-buttons-block').waitForDisplayed() | ||
32 | } | ||
33 | |||
22 | private getLoggedInInfoElem () { | 34 | private getLoggedInInfoElem () { |
23 | return $('.logged-in-display-name') | 35 | return $('.logged-in-display-name') |
24 | } | 36 | } |
37 | |||
38 | private getSuffix () { | ||
39 | return browser.config.baseUrl | ||
40 | ? browser.config.baseUrl.slice(-1) | ||
41 | : '1' | ||
42 | } | ||
25 | } | 43 | } |