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

28 lines
632 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-31 18:31:17 +00:00
constructor(path) {
super(path);
this.fileId = /download\/(\w+)\/#/.exec(path)[1];
2018-10-31 18:31:17 +00:00
this.downloadButton = '#download-btn';
this.downloadComplete = '#download-complete';
2018-10-02 20:15:02 +00:00
}
/**
* @function waitForPageToLoad
* @returns {Object} An object representing the page.
* @throws ElementNotFound
*/
waitForPageToLoad() {
super.waitForPageToLoad();
2018-10-31 18:31:17 +00:00
browser.waitForExist(this.downloadButton);
2018-10-02 20:15:02 +00:00
return this;
}
2018-10-31 18:31:17 +00:00
download() {
return browser.click(this.downloadButton);
2018-10-02 20:15:02 +00:00
}
}
2018-10-04 00:39:39 +00:00
module.exports = DownloadPage;