mailtrain/server/test/e2e/page-objects/user.js

34 lines
910 B
JavaScript
Raw Normal View History

2017-05-09 23:40:02 +00:00
'use strict';
const config = require('../lib/config');
const web = require('../lib/web');
2017-05-09 23:40:02 +00:00
module.exports = {
login: web({
baseUrl: config.baseTrustedUrl,
2017-05-09 23:40:02 +00:00
url: '/users/login',
elementsToWaitFor: ['submitButton'],
2017-05-09 23:40:02 +00:00
elements: {
usernameInput: 'form[action="/login"] input[name="username"]',
passwordInput: 'form[action="/login"] input[name="password"]',
submitButton: 'form[action="/login"] [type=submit]'
2017-05-09 23:40:02 +00:00
}
}),
logout: web({
baseUrl: config.baseTrustedUrl,
requestUrl: '/users/logout',
url: '/'
}),
account: web({
baseUrl: config.baseTrustedUrl,
2017-05-09 23:40:02 +00:00
url: '/users/account',
elementsToWaitFor: ['form'],
2017-05-09 23:40:02 +00:00
elements: {
2017-05-28 16:55:01 +00:00
form: 'form[action="/users/account"]',
2017-05-09 23:40:02 +00:00
emailInput: 'form[action="/users/account"] input[name="email"]'
}
2017-05-28 16:55:01 +00:00
})
};