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

35 lines
821 B
JavaScript
Raw Normal View History

2018-10-04 00:39:39 +00:00
/* global browser */
const Page = require('./page');
2018-10-02 20:15:02 +00:00
2018-10-04 00:39:39 +00:00
class DownloadPage extends Page {
2018-10-02 20:15:02 +00: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 00:39:39 +00:00
const el = browser.element(this.downloadBtnLocator);
2018-10-02 20:15:02 +00: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 00:39:39 +00:00
module.exports = DownloadPage;