1 import { getCheckbox } from '../utils'
3 export class SignupPage {
5 getRegisterMenuButton () {
6 return $('.create-account-button')
9 async clickOnRegisterInMenu () {
10 const button = this.getRegisterMenuButton()
12 await button.waitForClickable()
16 async validateStep () {
17 const next = $('button[type=submit]')
19 await next.waitForClickable()
24 const terms = await getCheckbox('terms')
25 await terms.waitForClickable()
30 async getEndMessage () {
31 const alert = $('.pt-alert-primary')
32 await alert.waitForDisplayed()
34 return alert.getText()
37 async fillRegistrationReason (reason: string) {
38 await $('#registrationReason').setValue(reason)
41 async fillAccountStep (options: {
47 await $('#displayName').setValue(options.displayName || `${options.username} display name`)
49 await $('#username').setValue(options.username)
50 await $('#password').setValue(options.password || 'password')
52 // Fix weird bug on firefox that "cannot scroll into view" when using just `setValue`
53 await $('#email').scrollIntoView({ block: 'center' })
54 await $('#email').waitForClickable()
55 await $('#email').setValue(options.email || `${options.username}@example.com`)
58 async fillChannelStep (options: {
62 await $('#displayName').setValue(options.displayName || `${options.name} channel display name`)
63 await $('#name').setValue(options.name)