send/test/integration/pages/desktop/download_page.js
2018-10-03 11:22:30 -07:00

32 lines
777 B
JavaScript

import Page from './page';
export default class DownloadPage extends Page {
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);
let el = browser.element(this.downloadBtnLocator);
return browser.elementIdDisplayed(el.value.ELEMENT);
});
return this;
}
downloadBtn() {
this.waitForPageToLoad();
return browser.click(this.downloadBtnLocator);
}
get downloadComplete() {
return this.downloadCompletedLocator;
}
}