aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/e2e/src/po/login.po.ts
blob: 8e3030e43ccad94a3c3a6ba9943ff14ee0aaa16b (plain) (tree)
1
2
3
4
5
6
7
8
9
                             


                            
                      
 

                                                                                                    
 

                                               
 
                             
 
                                              
 


                                                               

   

                                       

   
import { go } from '../utils'

export class LoginPage {
  async loginAsRootUser () {
    await go('/login')

    await browser.execute(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`)
    await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`)

    await $('input#username').setValue('root')
    await $('input#password').setValue('test1')

    await browser.pause(1000)

    await $('form input[type=submit]').click()

    await this.getLoggedInInfoElem().waitForExist()

    await expect(this.getLoggedInInfoElem()).toHaveText('root')
  }

  private getLoggedInInfoElem () {
    return $('.logged-in-display-name')
  }
}