drop.chapril.org-firefoxsend/test/integration/pages/desktop/download_page.js

35 lines
821 B
JavaScript
Raw Normal View History

2018-10-04 02:39:39 +02:00
/* global browser */
const Page = require('./page');
2018-10-02 22:15:02 +02:00
2018-10-04 02:39:39 +02:00
class DownloadPage extends Page {
2018-10-02 22:15:02 +02:00
constructor() {
super();
this.downloadBtnLocator = '.btn--download';
this.downloadCompletedLocator = '.btn--complete';
}
/**
* @function waitForPageToLoad
* @returns {Object} An object representing the page.
* @throws ElementNotFound
*/
waitForPageToLoad() {
browser.waitUntil(() => {
browser.waitForExist(this.downloadBtnLocator);
2018-10-04 02:39:39 +02:00
const el = browser.element(this.downloadBtnLocator);
2018-10-02 22:15:02 +02:00
return browser.elementIdDisplayed(el.value.ELEMENT);
});
return this;
}
downloadBtn() {
this.waitForPageToLoad();
return browser.click(this.downloadBtnLocator);
}
get downloadComplete() {
return this.downloadCompletedLocator;
}
}
2018-10-04 02:39:39 +02:00
module.exports = DownloadPage;