async clickOnRegisterInMenu () {
const button = this.getRegisterMenuButton()
- await button.waitForDisplayed()
+ await button.waitForClickable()
await button.click()
}
async checkTerms () {
const terms = await getCheckbox('terms')
+ await terms.waitForClickable()
return terms.click()
}
+ async getEndMessage () {
+ const alert = $('.pt-alert-primary')
+ await alert.waitForDisplayed()
+
+ return alert.getText()
+ }
+
+ async fillRegistrationReason (reason: string) {
+ await $('#registrationReason').setValue(reason)
+ }
+
async fillAccountStep (options: {
- displayName: string
username: string
- email: string
- password: string
+ password?: string
+ displayName?: string
+ email?: string
}) {
- if (options.displayName) {
- await $('#displayName').setValue(options.displayName)
- }
-
- if (options.username) {
- await $('#username').setValue(options.username)
- }
+ await $('#displayName').setValue(options.displayName || `${options.username} display name`)
- if (options.email) {
- await $('#email').setValue(options.email)
- }
+ await $('#username').setValue(options.username)
+ await $('#password').setValue(options.password || 'password')
- if (options.password) {
- await $('#password').setValue(options.password)
- }
+ // Fix weird bug on firefox that "cannot scroll into view" when using just `setValue`
+ await $('#email').scrollIntoView({ block: 'center' })
+ await $('#email').waitForClickable()
+ await $('#email').setValue(options.email || `${options.username}@example.com`)
}
async fillChannelStep (options: {
- displayName: string
name: string
+ displayName?: string
}) {
- if (options.displayName) {
- await $('#displayName').setValue(options.displayName)
- }
-
- if (options.name) {
- await $('#name').setValue(options.name)
- }
+ await $('#displayName').setValue(options.displayName || `${options.name} channel display name`)
+ await $('#name').setValue(options.name)
}
}