diff options
Diffstat (limited to 'client/e2e/src/po/login.po.ts')
-rw-r--r-- | client/e2e/src/po/login.po.ts | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/client/e2e/src/po/login.po.ts b/client/e2e/src/po/login.po.ts index 20412ee0d..8e3030e43 100644 --- a/client/e2e/src/po/login.po.ts +++ b/client/e2e/src/po/login.po.ts | |||
@@ -1,23 +1,25 @@ | |||
1 | import { browser, element, by } from 'protractor' | 1 | import { go } from '../utils' |
2 | 2 | ||
3 | export class LoginPage { | 3 | export class LoginPage { |
4 | async loginAsRootUser () { | 4 | async loginAsRootUser () { |
5 | await browser.get('/login') | 5 | await go('/login') |
6 | 6 | ||
7 | await browser.executeScript(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`) | 7 | await browser.execute(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`) |
8 | await browser.executeScript(`window.localStorage.setItem('no_welcome_modal', 'true')`) | 8 | await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`) |
9 | 9 | ||
10 | element(by.css('input#username')).sendKeys('root') | 10 | await $('input#username').setValue('root') |
11 | element(by.css('input#password')).sendKeys('test1') | 11 | await $('input#password').setValue('test1') |
12 | 12 | ||
13 | await browser.sleep(1000) | 13 | await browser.pause(1000) |
14 | 14 | ||
15 | await element(by.css('form input[type=submit]')).click() | 15 | await $('form input[type=submit]').click() |
16 | 16 | ||
17 | expect(this.getLoggedInInfo().getText()).toContain('root') | 17 | await this.getLoggedInInfoElem().waitForExist() |
18 | |||
19 | await expect(this.getLoggedInInfoElem()).toHaveText('root') | ||
18 | } | 20 | } |
19 | 21 | ||
20 | private getLoggedInInfo () { | 22 | private getLoggedInInfoElem () { |
21 | return element(by.css('.logged-in-display-name')) | 23 | return $('.logged-in-display-name') |
22 | } | 24 | } |
23 | } | 25 | } |