]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/e2e/src/po/login.po.ts
8e3030e43ccad94a3c3a6ba9943ff14ee0aaa16b
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / login.po.ts
1 import { go } from '../utils'
2
3 export class LoginPage {
4 async loginAsRootUser () {
5 await go('/login')
6
7 await browser.execute(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`)
8 await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`)
9
10 await $('input#username').setValue('root')
11 await $('input#password').setValue('test1')
12
13 await browser.pause(1000)
14
15 await $('form input[type=submit]').click()
16
17 await this.getLoggedInInfoElem().waitForExist()
18
19 await expect(this.getLoggedInInfoElem()).toHaveText('root')
20 }
21
22 private getLoggedInInfoElem () {
23 return $('.logged-in-display-name')
24 }
25 }