]>
Commit | Line | Data |
---|---|---|
1db86422 C |
1 | import { getCheckbox } from '../utils' |
2 | ||
3 | export class SignupPage { | |
4 | ||
5 | getRegisterMenuButton () { | |
6 | return $('.create-account-button') | |
7 | } | |
8 | ||
9 | async clickOnRegisterInMenu () { | |
10 | const button = this.getRegisterMenuButton() | |
11 | ||
12 | await button.waitForDisplayed() | |
13 | await button.click() | |
14 | } | |
15 | ||
16 | async validateStep () { | |
17 | const next = $('button[type=submit]') | |
18 | ||
19 | await next.waitForClickable() | |
20 | await next.click() | |
21 | } | |
22 | ||
23 | async checkTerms () { | |
24 | const terms = await getCheckbox('terms') | |
25 | ||
26 | return terms.click() | |
27 | } | |
28 | ||
29 | async fillAccountStep (options: { | |
30 | displayName: string | |
31 | username: string | |
32 | email: string | |
33 | password: string | |
34 | }) { | |
35 | if (options.displayName) { | |
36 | await $('#displayName').setValue(options.displayName) | |
37 | } | |
38 | ||
39 | if (options.username) { | |
40 | await $('#username').setValue(options.username) | |
41 | } | |
42 | ||
43 | if (options.email) { | |
44 | await $('#email').setValue(options.email) | |
45 | } | |
46 | ||
47 | if (options.password) { | |
48 | await $('#password').setValue(options.password) | |
49 | } | |
50 | } | |
51 | ||
52 | async fillChannelStep (options: { | |
53 | displayName: string | |
54 | name: string | |
55 | }) { | |
56 | if (options.displayName) { | |
57 | await $('#displayName').setValue(options.displayName) | |
58 | } | |
59 | ||
60 | if (options.name) { | |
61 | await $('#name').setValue(options.name) | |
62 | } | |
63 | } | |
64 | } |