]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/e2e/src/po/signup.po.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / signup.po.ts
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.waitForClickable()
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 await terms.waitForClickable()
26
27 return terms.click()
28 }
29
30 async fillAccountStep (options: {
31 displayName: string
32 username: string
33 email: string
34 password: string
35 }) {
36 if (options.displayName) {
37 await $('#displayName').setValue(options.displayName)
38 }
39
40 if (options.username) {
41 await $('#username').setValue(options.username)
42 }
43
44 if (options.email) {
45 // Fix weird bug on firefox that "cannot scroll into view" when using just `setValue`
46 await $('#email').scrollIntoView(false)
47 await $('#email').waitForClickable()
48 await $('#email').setValue(options.email)
49 }
50
51 if (options.password) {
52 await $('#password').setValue(options.password)
53 }
54 }
55
56 async fillChannelStep (options: {
57 displayName: string
58 name: string
59 }) {
60 if (options.displayName) {
61 await $('#displayName').setValue(options.displayName)
62 }
63
64 if (options.name) {
65 await $('#name').setValue(options.name)
66 }
67 }
68 }