Strip tracking url parameters

This commit is contained in:
Wiktor Furman 2019-10-15 15:29:48 +02:00
parent 0daa03e04c
commit 114068c531
4 changed files with 40 additions and 11 deletions

View file

@ -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);
}
}