mirror of
https://github.com/wassname/talk.git
synced 2026-09-11 12:51:33 +08:00
Refactor 2
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
module.exports = {
|
||||
commands: [{
|
||||
ready() {
|
||||
return this
|
||||
.waitForElementVisible('body');
|
||||
},
|
||||
login(user) {
|
||||
this
|
||||
.setValue('@emailInput', user.email)
|
||||
.setValue('@passwordInput', user.password)
|
||||
.waitForElementVisible('@signIn')
|
||||
.waitForElementVisible('@loginButton')
|
||||
.click('@loginButton');
|
||||
},
|
||||
register(user) {
|
||||
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'
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user