From a9285e11811f9aacd0f52844ec06c37708418c98 Mon Sep 17 00:00:00 2001 From: witzig Date: Sat, 27 May 2017 14:24:08 +0200 Subject: [PATCH] Fixed eslint errors --- test/e2e/.eslintrc | 5 +++-- test/e2e/index.js | 4 +--- test/e2e/lib/mail.js | 2 +- test/e2e/lib/mocha-e2e.js | 4 ++-- test/e2e/lib/page.js | 5 ++--- test/e2e/lib/semaphore.js | 4 ++-- test/e2e/lib/web.js | 2 +- test/e2e/page-objects/user.js | 2 +- test/e2e/tests/login.js | 2 +- test/e2e/tests/subscription.js | 2 +- 10 files changed, 15 insertions(+), 17 deletions(-) diff --git a/test/e2e/.eslintrc b/test/e2e/.eslintrc index 836bac9a..a5157382 100644 --- a/test/e2e/.eslintrc +++ b/test/e2e/.eslintrc @@ -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 diff --git a/test/e2e/index.js b/test/e2e/index.js index 5dd54d00..dce40875 100644 --- a/test/e2e/index.js +++ b/test/e2e/index.js @@ -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'; diff --git a/test/e2e/lib/mail.js b/test/e2e/lib/mail.js index b0f41872..47d5a631 100644 --- a/test/e2e/lib/mail.js +++ b/test/e2e/lib/mail.js @@ -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.'); }, diff --git a/test/e2e/lib/mocha-e2e.js b/test/e2e/lib/mocha-e2e.js index 96c557a2..4ea1f66d 100644 --- a/test/e2e/lib/mocha-e2e.js +++ b/test/e2e/lib/mocha-e2e.js @@ -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', () => { diff --git a/test/e2e/lib/page.js b/test/e2e/lib/page.js index 07064af7..3026f671 100644 --- a/test/e2e/lib/page.js +++ b/test/e2e/lib/page.js @@ -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); diff --git a/test/e2e/lib/semaphore.js b/test/e2e/lib/semaphore.js index d22b8f71..89366b3e 100644 --- a/test/e2e/lib/semaphore.js +++ b/test/e2e/lib/semaphore.js @@ -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); - }) + }); } } diff --git a/test/e2e/lib/web.js b/test/e2e/lib/web.js index 692c0214..9e345219 100644 --- a/test/e2e/lib/web.js +++ b/test/e2e/lib/web.js @@ -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); diff --git a/test/e2e/page-objects/user.js b/test/e2e/page-objects/user.js index 52f8377f..2facc345 100644 --- a/test/e2e/page-objects/user.js +++ b/test/e2e/page-objects/user.js @@ -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"]' } }), diff --git a/test/e2e/tests/login.js b/test/e2e/tests/login.js index 571389be..c4f47d35 100644 --- a/test/e2e/tests/login.js +++ b/test/e2e/tests/login.js @@ -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 () => { diff --git a/test/e2e/tests/subscription.js b/test/e2e/tests/subscription.js index fec05937..dabdc914 100644 --- a/test/e2e/tests/subscription.js +++ b/test/e2e/tests/subscription.js @@ -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 () => {