mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-08 07:00:54 +03:00
Strip tracking url parameters
This commit is contained in:
@@ -4,23 +4,22 @@ const Page = require('./page');
|
||||
class DownloadPage extends Page {
|
||||
constructor(path) {
|
||||
super(path);
|
||||
this.fileId = /download\/(\w+)\/#/.exec(path)[1];
|
||||
this.fileId = /download\/(\w+)\/\??.*#/.exec(path)[1];
|
||||
this.downloadButton = '#download-btn';
|
||||
this.downloadComplete = '#download-complete';
|
||||
this.passwordInput = '#password-input';
|
||||
this.passwordButton = '#password-btn';
|
||||
}
|
||||
|
||||
/**
|
||||
* @function waitForPageToLoad
|
||||
* @returns {Object} An object representing the page.
|
||||
* @throws ElementNotFound
|
||||
*/
|
||||
waitForPageToLoad() {
|
||||
super.waitForPageToLoad();
|
||||
browser.waitForExist(this.downloadButton);
|
||||
return this;
|
||||
downloadUsingPassword(password) {
|
||||
browser.waitForExist(this.passwordInput);
|
||||
browser.setValue(this.passwordInput, password);
|
||||
browser.click(this.passwordButton);
|
||||
return browser.click(this.downloadButton);
|
||||
}
|
||||
|
||||
download() {
|
||||
browser.waitForExist(this.downloadButton);
|
||||
return browser.click(this.downloadButton);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user