2017-05-09 23:40:02 +00:00
|
|
|
'use strict';
|
|
|
|
|
2017-05-23 02:15:32 +00:00
|
|
|
const page = require('./web');
|
2017-05-09 23:40:02 +00:00
|
|
|
|
|
|
|
module.exports = driver => ({
|
|
|
|
|
2017-05-10 14:18:35 +00:00
|
|
|
login: Object.assign(page(driver), {
|
2017-05-09 23:40:02 +00:00
|
|
|
url: '/users/login',
|
|
|
|
elementToWaitFor: 'submitButton',
|
|
|
|
elements: {
|
|
|
|
usernameInput: 'form[action="/users/login"] input[name="username"]',
|
|
|
|
passwordInput: 'form[action="/users/login"] input[name="password"]',
|
|
|
|
submitButton: 'form[action="/users/login"] [type=submit]'
|
2017-05-10 14:18:35 +00:00
|
|
|
},
|
|
|
|
enterUsername(value) {
|
|
|
|
// this.element('usernameInput').clear();
|
|
|
|
return this.element('usernameInput').sendKeys(value);
|
|
|
|
},
|
|
|
|
enterPassword(value) {
|
|
|
|
return this.element('passwordInput').sendKeys(value);
|
2017-05-09 23:40:02 +00:00
|
|
|
}
|
|
|
|
}),
|
|
|
|
|
2017-05-10 14:18:35 +00:00
|
|
|
account: Object.assign(page(driver), {
|
2017-05-09 23:40:02 +00:00
|
|
|
url: '/users/account',
|
|
|
|
elementToWaitFor: 'emailInput',
|
|
|
|
elements: {
|
|
|
|
emailInput: 'form[action="/users/account"] input[name="email"]'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|