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

27 lines
743 B
JavaScript
Raw Permalink 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);
2019-10-15 13:29:48 +00:00
this.fileId = /download\/(\w+)\/\??.*#/.exec(path)[1];
2018-10-31 18:31:17 +00:00
this.downloadButton = '#download-btn';
this.downloadComplete = '#download-complete';
2019-10-15 13:29:48 +00:00
this.passwordInput = '#password-input';
this.passwordButton = '#password-btn';
2018-10-02 20:15:02 +00:00
}
2019-10-15 13:29:48 +00:00
downloadUsingPassword(password) {
browser.waitForExist(this.passwordInput);
browser.setValue(this.passwordInput, password);
browser.click(this.passwordButton);
return browser.click(this.downloadButton);
2018-10-02 20:15:02 +00:00
}
2018-10-31 18:31:17 +00:00
download() {
2019-10-15 13:29:48 +00:00
browser.waitForExist(this.downloadButton);
2018-10-31 18:31:17 +00:00
return browser.click(this.downloadButton);
2018-10-02 20:15:02 +00:00
}
}
2018-10-04 00:39:39 +00:00
module.exports = DownloadPage;