2017-08-17 00:31:49 +08:00
|
|
|
'use strict';
|
|
|
|
|
2017-12-02 04:15:06 +08:00
|
|
|
let expect = require('chai').expect;
|
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) {
|
2017-12-02 04:15:06 +08:00
|
|
|
expect(browser.select(browserName).getTitle()).to.equal(title);
|
2017-08-17 00:31:49 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
assertUrl(url) {
|
|
|
|
browser.remotes.forEach(function(browserName) {
|
2017-12-02 04:15:06 +08:00
|
|
|
expect(browser.getUrl()[browserName]).to.equal(url);
|
2017-08-17 00:31:49 +08:00
|
|
|
});
|
|
|
|
}
|
2017-08-22 02:29:25 +08:00
|
|
|
setUsername(map) {
|
|
|
|
map.forEach((v, k) => browser.select(k).setValue(LandingPage.usernameInputSelector, v));
|
|
|
|
}
|
2017-12-02 04:15:06 +08:00
|
|
|
expectImageMatch(results, errorMessage) {
|
|
|
|
results.forEach((result) => expect(result.isExactSameImage, errorMessage).to.be.true);
|
|
|
|
}
|
2017-08-17 00:31:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = new Utils();
|
|
|
|
|