2017-08-17 00:31:49 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
let chai = require('chai');
|
2017-08-22 02:29:25 +08:00
|
|
|
let LandingPage = require('./pageobjects/landing.page');
|
2017-08-17 00:31:49 +08:00
|
|
|
|
|
|
|
class Utils {
|
|
|
|
assertTitle(title) {
|
|
|
|
browser.remotes.forEach(function(browserName) {
|
|
|
|
chai.expect(browser.select(browserName).getTitle()).to.equal(title);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
assertUrl(url) {
|
|
|
|
browser.remotes.forEach(function(browserName) {
|
|
|
|
chai.expect(browser.getUrl()[browserName]).to.equal(url);
|
|
|
|
});
|
|
|
|
}
|
2017-08-22 02:29:25 +08:00
|
|
|
setUsername(map) {
|
|
|
|
map.forEach((v, k) => browser.select(k).setValue(LandingPage.usernameInputSelector, v));
|
|
|
|
}
|
2017-08-17 00:31:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = new Utils();
|
|
|
|
|