Fixed eslint errors
This commit is contained in:
parent
2160a10338
commit
a9285e1181
10 changed files with 15 additions and 17 deletions
|
@ -2,8 +2,9 @@
|
|||
"parser": "babel-eslint",
|
||||
"rules": {
|
||||
"strict": 0,
|
||||
"no-invalid-this": 0,
|
||||
"no-unused-expressions": 0
|
||||
"no-console": 0,
|
||||
"comma-dangle": 0,
|
||||
"arrow-body-style": 0
|
||||
},
|
||||
"env": {
|
||||
"mocha": true
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
require('./lib/exit-unless-test');
|
||||
const { mocha, driver } = require('./lib/mocha-e2e');
|
||||
const mocha = require('./lib/mocha-e2e').mocha;
|
||||
const path = require('path');
|
||||
|
||||
global.USE_SHARED_DRIVER = true;
|
||||
|
||||
const only = 'only';
|
||||
const skip = 'skip';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ module.exports = (...extras) => page({
|
|||
await this.waitUntilVisible();
|
||||
},
|
||||
|
||||
async ensureUrl(path) {
|
||||
async ensureUrl(path) { // eslint-disable-line no-unused-vars
|
||||
throw new Error('Unsupported method.');
|
||||
},
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ function UseCaseReporter(runner) {
|
|||
return Array(indents).join(' ');
|
||||
}
|
||||
|
||||
runner.on('start', function () {
|
||||
runner.on('start', () => {
|
||||
console.log();
|
||||
});
|
||||
|
||||
|
@ -104,7 +104,7 @@ function UseCaseReporter(runner) {
|
|||
console.log();
|
||||
console.log(err);
|
||||
console.log();
|
||||
console.log(`Snaphot of and info about the current page are in last-failed-e2e-test.*`);
|
||||
console.log('Snaphot of and info about the current page are in last-failed-e2e-test.*');
|
||||
});
|
||||
|
||||
runner.on('end', () => {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const config = require('./config');
|
||||
const webdriver = require('selenium-webdriver');
|
||||
const By = webdriver.By;
|
||||
const until = webdriver.until;
|
||||
|
@ -45,7 +44,7 @@ module.exports = (...extras) => Object.assign({
|
|||
}
|
||||
|
||||
for (const text of (this.textsToWaitFor || [])) {
|
||||
await driver.wait(new webdriver.Condition(`for text "${text}"`, async (driver) => {
|
||||
await driver.wait(new webdriver.Condition(`for text "${text}"`, async () => {
|
||||
return await this.containsText(text);
|
||||
}), waitTimeout);
|
||||
}
|
||||
|
@ -58,7 +57,7 @@ module.exports = (...extras) => Object.assign({
|
|||
},
|
||||
|
||||
async waitUntilVisibleAfterRefresh(selector) {
|
||||
await driver.wait(new webdriver.Condition('for refresh', async (driver) => {
|
||||
await driver.wait(new webdriver.Condition('for refresh', async () => {
|
||||
const val = await driver.executeScript('return document.mailTrainRefreshAcknowledged;');
|
||||
return !val;
|
||||
}), waitTimeout);
|
||||
|
|
|
@ -19,7 +19,7 @@ class Semaphore {
|
|||
const self = this;
|
||||
|
||||
function wait(resolve) {
|
||||
if (self.counter == 0) {
|
||||
if (self.counter === 0) {
|
||||
resolve();
|
||||
} else {
|
||||
setTimeout(wait, 500, resolve);
|
||||
|
@ -28,7 +28,7 @@ class Semaphore {
|
|||
|
||||
return new Promise(resolve => {
|
||||
setTimeout(wait, 500, resolve);
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ module.exports = (...extras) => page({
|
|||
path = pathOrParams;
|
||||
} else {
|
||||
const urlPattern = new UrlPattern(this.requestUrl || this.url);
|
||||
path = urlPattern.stringify(pathOrParams)
|
||||
path = urlPattern.stringify(pathOrParams);
|
||||
}
|
||||
|
||||
const parsedUrl = url.parse(path);
|
||||
|
|
|
@ -22,7 +22,7 @@ module.exports = {
|
|||
url: '/users/account',
|
||||
elementsToWaitFor: ['form'],
|
||||
elements: {
|
||||
form: `form[action="/users/account"]`,
|
||||
form: 'form[action="/users/account"]',
|
||||
emailInput: 'form[action="/users/account"] input[name="email"]'
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -7,7 +7,7 @@ const expect = require('chai').expect;
|
|||
const page = require('../page-objects/user');
|
||||
const home = require('../page-objects/home');
|
||||
|
||||
suite('Login use-cases', function() {
|
||||
suite('Login use-cases', () => {
|
||||
before(() => driver.manage().deleteAllCookies());
|
||||
|
||||
test('User can access home page', async () => {
|
||||
|
|
|
@ -67,7 +67,7 @@ async function subscriptionExistsPrecondition(subscription) {
|
|||
return subscription;
|
||||
}
|
||||
|
||||
suite('Subscription use-cases', function() {
|
||||
suite('Subscription use-cases', () => {
|
||||
before(() => driver.manage().deleteAllCookies());
|
||||
|
||||
useCase('Subscription to a public list (main scenario)', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue