fox-send/test/integration/pages/desktop/page.js

28 lines
539 B
JavaScript
Raw Permalink Normal View History

/* global browser window */
2018-10-04 00:39:39 +00:00
class Page {
2018-10-31 18:31:17 +00:00
constructor(path) {
this.path = path;
}
2018-10-02 20:15:02 +00:00
2018-10-31 18:31:17 +00:00
open() {
browser.url(this.path);
2018-10-02 20:15:02 +00:00
this.waitForPageToLoad();
}
/**
* @function waitForPageToLoad
* @returns {Object} An object representing the page.
* @throws ElementNotFound
*/
2018-10-31 18:31:17 +00:00
waitForPageToLoad() {
browser.waitUntil(function() {
return browser.execute(function() {
return typeof window.app !== 'undefined';
});
}, 3000);
browser.pause(100);
2018-10-31 18:31:17 +00:00
return this;
}
2018-10-02 20:15:02 +00:00
}
2018-10-04 00:39:39 +00:00
module.exports = Page;