Fixed eslint errors

This commit is contained in:
witzig 2017-05-27 14:24:08 +02:00
parent 2160a10338
commit a9285e1181
10 changed files with 15 additions and 17 deletions

View file

@ -2,8 +2,9 @@
"parser": "babel-eslint", "parser": "babel-eslint",
"rules": { "rules": {
"strict": 0, "strict": 0,
"no-invalid-this": 0, "no-console": 0,
"no-unused-expressions": 0 "comma-dangle": 0,
"arrow-body-style": 0
}, },
"env": { "env": {
"mocha": true "mocha": true

View file

@ -1,11 +1,9 @@
'use strict'; 'use strict';
require('./lib/exit-unless-test'); require('./lib/exit-unless-test');
const { mocha, driver } = require('./lib/mocha-e2e'); const mocha = require('./lib/mocha-e2e').mocha;
const path = require('path'); const path = require('path');
global.USE_SHARED_DRIVER = true;
const only = 'only'; const only = 'only';
const skip = 'skip'; const skip = 'skip';

View file

@ -12,7 +12,7 @@ module.exports = (...extras) => page({
await this.waitUntilVisible(); await this.waitUntilVisible();
}, },
async ensureUrl(path) { async ensureUrl(path) { // eslint-disable-line no-unused-vars
throw new Error('Unsupported method.'); throw new Error('Unsupported method.');
}, },

View file

@ -25,7 +25,7 @@ function UseCaseReporter(runner) {
return Array(indents).join(' '); return Array(indents).join(' ');
} }
runner.on('start', function () { runner.on('start', () => {
console.log(); console.log();
}); });
@ -104,7 +104,7 @@ function UseCaseReporter(runner) {
console.log(); console.log();
console.log(err); console.log(err);
console.log(); 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', () => { runner.on('end', () => {

View file

@ -1,6 +1,5 @@
'use strict'; 'use strict';
const config = require('./config');
const webdriver = require('selenium-webdriver'); const webdriver = require('selenium-webdriver');
const By = webdriver.By; const By = webdriver.By;
const until = webdriver.until; const until = webdriver.until;
@ -45,7 +44,7 @@ module.exports = (...extras) => Object.assign({
} }
for (const text of (this.textsToWaitFor || [])) { 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); return await this.containsText(text);
}), waitTimeout); }), waitTimeout);
} }
@ -58,7 +57,7 @@ module.exports = (...extras) => Object.assign({
}, },
async waitUntilVisibleAfterRefresh(selector) { 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;'); const val = await driver.executeScript('return document.mailTrainRefreshAcknowledged;');
return !val; return !val;
}), waitTimeout); }), waitTimeout);

View file

@ -19,7 +19,7 @@ class Semaphore {
const self = this; const self = this;
function wait(resolve) { function wait(resolve) {
if (self.counter == 0) { if (self.counter === 0) {
resolve(); resolve();
} else { } else {
setTimeout(wait, 500, resolve); setTimeout(wait, 500, resolve);
@ -28,7 +28,7 @@ class Semaphore {
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(wait, 500, resolve); setTimeout(wait, 500, resolve);
}) });
} }
} }

View file

@ -15,7 +15,7 @@ module.exports = (...extras) => page({
path = pathOrParams; path = pathOrParams;
} else { } else {
const urlPattern = new UrlPattern(this.requestUrl || this.url); const urlPattern = new UrlPattern(this.requestUrl || this.url);
path = urlPattern.stringify(pathOrParams) path = urlPattern.stringify(pathOrParams);
} }
const parsedUrl = url.parse(path); const parsedUrl = url.parse(path);

View file

@ -22,7 +22,7 @@ module.exports = {
url: '/users/account', url: '/users/account',
elementsToWaitFor: ['form'], elementsToWaitFor: ['form'],
elements: { elements: {
form: `form[action="/users/account"]`, form: 'form[action="/users/account"]',
emailInput: 'form[action="/users/account"] input[name="email"]' emailInput: 'form[action="/users/account"] input[name="email"]'
} }
}), }),

View file

@ -7,7 +7,7 @@ const expect = require('chai').expect;
const page = require('../page-objects/user'); const page = require('../page-objects/user');
const home = require('../page-objects/home'); const home = require('../page-objects/home');
suite('Login use-cases', function() { suite('Login use-cases', () => {
before(() => driver.manage().deleteAllCookies()); before(() => driver.manage().deleteAllCookies());
test('User can access home page', async () => { test('User can access home page', async () => {

View file

@ -67,7 +67,7 @@ async function subscriptionExistsPrecondition(subscription) {
return subscription; return subscription;
} }
suite('Subscription use-cases', function() { suite('Subscription use-cases', () => {
before(() => driver.manage().deleteAllCookies()); before(() => driver.manage().deleteAllCookies());
useCase('Subscription to a public list (main scenario)', async () => { useCase('Subscription to a public list (main scenario)', async () => {