mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 18:45:55 +08:00
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
module.exports = {
|
|
commands: [{
|
|
ready() {
|
|
return this
|
|
.waitForElementVisible('body');
|
|
},
|
|
login(user) {
|
|
return this
|
|
.setValue('@emailInput', user.email)
|
|
.setValue('@passwordInput', user.password)
|
|
.waitForElementVisible('@signIn')
|
|
.waitForElementVisible('@loginButton')
|
|
.click('@loginButton');
|
|
},
|
|
register(user) {
|
|
return this
|
|
.waitForElementVisible('@registerButton')
|
|
.click('@registerButton')
|
|
.setValue('@emailInput', user.email)
|
|
.setValue('@usernameInput', user.username)
|
|
.setValue('@passwordInput', user.password)
|
|
.setValue('@confirmPasswordInput', user.password)
|
|
.waitForElementVisible('@signUpButton')
|
|
.click('@signUpButton')
|
|
.waitForElementVisible('@signIn')
|
|
.waitForElementVisible('@loginButton')
|
|
.click('@loginButton');
|
|
},
|
|
}],
|
|
elements: {
|
|
registerButton: '#coralRegister',
|
|
signInButton: '#coralSignInButton',
|
|
emailInput: '#email',
|
|
usernameInput: '#username',
|
|
passwordInput: '#password',
|
|
confirmPasswordInput: '#confirmPassword',
|
|
signUpButton: '#coralSignUpButton',
|
|
signIn: '.coral-sign-in',
|
|
loginButton: '#coralLogInButton'
|
|
},
|
|
};
|