Fixed eslint errors.
This commit is contained in:
parent
c11d1a1cbf
commit
c17bc9f2cf
10 changed files with 268 additions and 280 deletions
|
@ -1,6 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const config = require('./config');
|
||||
const webdriver = require('selenium-webdriver');
|
||||
const By = webdriver.By;
|
||||
const until = webdriver.until;
|
||||
|
@ -33,7 +32,7 @@ module.exports = (...extras) => Object.assign({
|
|||
return params;
|
||||
},
|
||||
|
||||
async waitUntilVisible(selector) {
|
||||
async waitUntilVisible() {
|
||||
await driver.wait(until.elementLocated(By.css('body')), waitTimeout);
|
||||
|
||||
for (const elem of (this.elementsToWaitFor || [])) {
|
||||
|
@ -45,9 +44,7 @@ module.exports = (...extras) => Object.assign({
|
|||
}
|
||||
|
||||
for (const text of (this.textsToWaitFor || [])) {
|
||||
await driver.wait(new webdriver.Condition(`for text "${text}"`, async (driver) => {
|
||||
return await this.containsText(text);
|
||||
}), waitTimeout);
|
||||
await driver.wait(new webdriver.Condition(`for text "${text}"`, async () => await this.containsText(text)), waitTimeout);
|
||||
}
|
||||
|
||||
if (this.url) {
|
||||
|
@ -57,13 +54,13 @@ module.exports = (...extras) => Object.assign({
|
|||
await driver.executeScript('document.mailTrainRefreshAcknowledged = true;');
|
||||
},
|
||||
|
||||
async waitUntilVisibleAfterRefresh(selector) {
|
||||
await driver.wait(new webdriver.Condition('for refresh', async (driver) => {
|
||||
async waitUntilVisibleAfterRefresh() {
|
||||
await driver.wait(new webdriver.Condition('for refresh', async driver => {
|
||||
const val = await driver.executeScript('return document.mailTrainRefreshAcknowledged;');
|
||||
return !val;
|
||||
}), waitTimeout);
|
||||
|
||||
await this.waitUntilVisible(selector);
|
||||
await this.waitUntilVisible();
|
||||
},
|
||||
|
||||
async click(key) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue