updated integration tests for new ui

This commit is contained in:
Danny Coates 2018-10-31 11:31:17 -07:00
parent 891ffc20af
commit 6ba3be8a0f
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
11 changed files with 65 additions and 153 deletions

View file

@ -2,10 +2,10 @@
const Page = require('./page');
class DownloadPage extends Page {
constructor() {
super();
this.downloadBtnLocator = '.btn--download';
this.downloadCompletedLocator = '.btn--complete';
constructor(path) {
super(path);
this.downloadButton = '#download-btn';
this.downloadComplete = '#download-complete';
}
/**
@ -14,21 +14,12 @@ class DownloadPage extends Page {
* @throws ElementNotFound
*/
waitForPageToLoad() {
browser.waitUntil(() => {
browser.waitForExist(this.downloadBtnLocator);
const el = browser.element(this.downloadBtnLocator);
return browser.elementIdDisplayed(el.value.ELEMENT);
});
browser.waitForExist(this.downloadButton);
return this;
}
downloadBtn() {
this.waitForPageToLoad();
return browser.click(this.downloadBtnLocator);
}
get downloadComplete() {
return this.downloadCompletedLocator;
download() {
return browser.click(this.downloadButton);
}
}
module.exports = DownloadPage;