2018-10-04 00:39:39 +00:00
|
|
|
/* global browser */
|
|
|
|
const Page = require('./page');
|
|
|
|
const SharePage = require('./share_page');
|
2018-10-02 20:15:02 +00:00
|
|
|
|
2018-10-04 00:39:39 +00:00
|
|
|
class ProgressPage extends Page {
|
2018-10-02 20:15:02 +00:00
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.cancelBtnLocator = '.uploadCancel';
|
|
|
|
this.progressIconLocator = '.btn--stripes';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @function waitForPageToLoad
|
|
|
|
* @returns {Object} An object representing the Share page.
|
|
|
|
* @throws ElementNotFound
|
|
|
|
*/
|
|
|
|
waitForPageToLoad() {
|
|
|
|
browser.waitUntil(() => {
|
|
|
|
browser.waitForExist(this.progressIconLocator);
|
2018-10-04 00:39:39 +00:00
|
|
|
const el = browser.element(this.progressIconLocator);
|
2018-10-02 20:15:02 +00:00
|
|
|
return browser.elementIdDisplayed(el.value.ELEMENT);
|
|
|
|
});
|
2018-10-04 00:39:39 +00:00
|
|
|
const sharePage = new SharePage();
|
2018-10-02 20:15:02 +00:00
|
|
|
return sharePage.waitForPageToLoad();
|
|
|
|
}
|
|
|
|
|
|
|
|
get cancelBtn() {
|
|
|
|
return this.cancelBtnLocator;
|
|
|
|
}
|
|
|
|
}
|
2018-10-04 00:39:39 +00:00
|
|
|
module.exports = ProgressPage;
|