1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-14 23:22:36 +01:00
send/test/integration/pages/desktop/page.js
Danny Coates 1c44d1d0f9
added /config endpoint, use fewer globals (#1172)
* added /config endpoint, use fewer globals

* fixed integration tests
2019-02-26 10:39:50 -08:00

28 lines
539 B
JavaScript

/* global browser window */
class Page {
constructor(path) {
this.path = path;
}
open() {
browser.url(this.path);
this.waitForPageToLoad();
}
/**
* @function waitForPageToLoad
* @returns {Object} An object representing the page.
* @throws ElementNotFound
*/
waitForPageToLoad() {
browser.waitUntil(function() {
return browser.execute(function() {
return typeof window.app !== 'undefined';
});
}, 3000);
browser.pause(100);
return this;
}
}
module.exports = Page;