1 import { go } from '../utils'
3 export class LoginPage {
5 async loginAsRootUser () {
8 await browser.execute(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`)
9 await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`)
11 await $('input#username').setValue('root')
12 await $('input#password').setValue('test' + this.getSuffix())
14 await browser.pause(1000)
16 await $('form input[type=submit]').click()
18 await this.getLoggedInInfoElem().waitForExist()
20 await expect(this.getLoggedInInfoElem()).toHaveText('root')
24 await $('.logged-in-more').click()
26 const logout = () => $('.dropdown-item*=Log out')
28 await logout().waitForDisplayed()
29 await logout().click()
31 await $('.login-buttons-block').waitForDisplayed()
34 private getLoggedInInfoElem () {
35 return $('.logged-in-display-name')
38 private getSuffix () {
39 return browser.config.baseUrl
40 ? browser.config.baseUrl.slice(-1)