diff --git a/.eslintrc.json b/.eslintrc.json index 571bbba05..3d7fa61c7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,34 +23,18 @@ "prefer-rest-params": 0, "no-useless-escape": 0, "no-restricted-syntax": 0, - "one-var": 0, "no-unused-expressions": 0, - "eqeqeq": 0, "guard-for-in": 0, "no-multi-assign": 0, "require-yield": 0, "prefer-spread": 0, - "radix": 0, "import/no-dynamic-require": 0, - "prefer-const": 0, - "no-empty": 0, - "no-tabs": 0, "no-continue": 0, "no-mixed-operators": 0, "default-case": 0, "import/no-extraneous-dependencies": 0, - "no-bitwise": 0, - "no-array-constructor": 0, "no-cond-assign": 0, - "no-var": 0, - "no-buffer-constructor": 0, - "no-eval": 0, "array-callback-return": 0, - "no-loop-func": 0, - "quotes": 0, - "import/no-unresolved": 0, - "no-redeclare": 0, - "function-paren-newline": 0, - "no-useless-return": 0 + "function-paren-newline": 0 } } diff --git a/examples/pages/Admin.js b/examples/pages/Admin.js index a0f35d937..7d7b018f0 100644 --- a/examples/pages/Admin.js +++ b/examples/pages/Admin.js @@ -3,7 +3,7 @@ let I; module.exports = { _init() { - I = require('codeceptjs/actor')(); + I = actor(); }, // insert your locators and methods here diff --git a/lib/codecept.js b/lib/codecept.js index ec8df7c6a..4b58591db 100644 --- a/lib/codecept.js +++ b/lib/codecept.js @@ -20,7 +20,7 @@ class Codecept { constructor(config, opts) { this.config = Config.create(config); this.opts = opts; - this.testFiles = new Array(); + this.testFiles = []; } /** diff --git a/lib/command/init.js b/lib/command/init.js index 92c986d51..7e95d8d88 100644 --- a/lib/command/init.js +++ b/lib/command/init.js @@ -195,11 +195,9 @@ module.exports = function (initPath) { print('Configure helpers...'); inquirer.prompt(helperConfigs, (helperResult) => { Object.keys(helperResult).forEach((key) => { - let helperName, - configName; const parts = key.split('_'); - helperName = parts[0]; - configName = parts[1]; + const helperName = parts[0]; + const configName = parts[1]; if (!configName) return; config.helpers[helperName][configName] = helperResult[key]; }); diff --git a/lib/command/run-multiple.js b/lib/command/run-multiple.js index 3b1abfeb8..bde098cec 100644 --- a/lib/command/run-multiple.js +++ b/lib/command/run-multiple.js @@ -9,8 +9,8 @@ const output = require('../output'); const path = require('path'); const runner = path.join(__dirname, '/../../bin/codecept'); -let config, - childOpts = {}; +let config; +const childOpts = {}; const copyOptions = ['steps', 'reporter', 'verbose', 'config', 'reporter-options', 'grep', 'fgrep', 'debug']; // codeceptjs run:multiple smoke:chrome regression:firefox - will launch smoke suite in chrome and regression in firefox diff --git a/lib/command/run.js b/lib/command/run.js index c0a79340f..b6a3ac4db 100644 --- a/lib/command/run.js +++ b/lib/command/run.js @@ -13,8 +13,8 @@ module.exports = function (test, options) { // registering options globally to use in config process.profile = options.profile; const configFile = options.config; - let codecept, - outputDir; + let codecept; + let outputDir; const testRoot = getTestRoot(configFile); let config = getConfig(configFile); diff --git a/lib/config.js b/lib/config.js index 0ccd790fa..2f0c30028 100644 --- a/lib/config.js +++ b/lib/config.js @@ -95,12 +95,12 @@ module.exports = Config; function loadConfigFile(configFile) { // .conf.js config file - if (path.extname(configFile) == '.js') { + if (path.extname(configFile) === '.js') { return Config.create(require(configFile).config); } // json config provided - if (path.extname(configFile) == '.json') { + if (path.extname(configFile) === '.json') { return Config.create(JSON.parse(fs.readFileSync(configFile, 'utf8'))); } throw new Error(`Config file ${configFile} can't be loaded`); diff --git a/lib/container.js b/lib/container.js index 59044287a..099d8cc35 100644 --- a/lib/container.js +++ b/lib/container.js @@ -148,7 +148,7 @@ function createSupportObjects(config) { if (!objects.I) { objects.I = require('./actor')(); - if (container.translation.I != 'I') { + if (container.translation.I !== 'I') { objects[container.translation.I] = objects.I; } } diff --git a/lib/data/table.js b/lib/data/table.js index d5c50dfc3..9b22873e8 100644 --- a/lib/data/table.js +++ b/lib/data/table.js @@ -4,7 +4,7 @@ class DataTable { constructor(array) { this.array = array; - this.rows = new Array(); + this.rows = []; } add(array) { diff --git a/lib/helper/Appium.js b/lib/helper/Appium.js index e9c436b64..e52d55c72 100644 --- a/lib/helper/Appium.js +++ b/lib/helper/Appium.js @@ -333,7 +333,7 @@ class Appium extends WebdriverIO { * I.seeAppIsInstalled("com.example.android.apis"); * ``` * - * @param bundleId String ID of bundled app + * @param bundleId String ID of bundled app * * Appium: support only Android */ @@ -349,7 +349,7 @@ class Appium extends WebdriverIO { * I.seeAppIsNotInstalled("com.example.android.apis"); * ``` * - * @param bundleId String ID of bundled app + * @param bundleId String ID of bundled app * * Appium: support only Android */ @@ -379,7 +379,7 @@ class Appium extends WebdriverIO { * ```js * I.removeApp('com.example.android.apis'); * ``` - * @param bundleId String ID of bundled app + * @param bundleId String ID of bundled app * * Appium: support only Android */ @@ -678,7 +678,7 @@ class Appium extends WebdriverIO { * I.hideDeviceKeyboard('pressKey', 'Done'); * ``` * - * @param strategy desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’) + * @param strategy desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’) * * Appium: support Android and iOS */ @@ -696,7 +696,7 @@ class Appium extends WebdriverIO { * I.sendDeviceKeyEvent(3); * ``` * - * @param keyValue Device specific key value + * @param keyValue Device specific key value * * Appium: support only Android */ @@ -1255,7 +1255,6 @@ function parseLocator(locator) { // in the end of a file function onlyForApps(expectedPlatform) { - let callerName; const stack = new Error().stack || ''; const re = /Appium.(\w+)/g; const caller = stack.split('\n')[2].trim(); @@ -1265,7 +1264,7 @@ function onlyForApps(expectedPlatform) { throw new Error(`Invalid caller ${caller}`); } - callerName = m[1] || m[2]; + const callerName = m[1] || m[2]; if (!expectedPlatform) { if (!this.platform) { throw new Error(`${callerName} method can be used only with apps`); diff --git a/lib/helper/Mochawesome.js b/lib/helper/Mochawesome.js index e6915ea58..5c78ef93c 100644 --- a/lib/helper/Mochawesome.js +++ b/lib/helper/Mochawesome.js @@ -44,7 +44,7 @@ class Mochawesome extends Helper { if (this.options.disableScreenshots) return; let fileName; // Get proper name if we are fail on hook - if (test.ctx.test.type == 'hook') { + if (test.ctx.test.type === 'hook') { currentTest = { test: test.ctx.test }; // ignore retries if we are in hook test._retries = -1; @@ -57,7 +57,7 @@ class Mochawesome extends Helper { const uuid = test.uuid || test.ctx.test.uuid; fileName = `${fileName.substring(0, 10)}_${uuid}`; } - if (test._retries < 1 || test._retries == test.retryNum) { + if (test._retries < 1 || test._retries === test.retryNum) { fileName = `${fileName}.failed.png`; return addMochawesomeContext(currentTest, fileName); } diff --git a/lib/helper/Nightmare.js b/lib/helper/Nightmare.js index 67cab9560..b527bc26a 100644 --- a/lib/helper/Nightmare.js +++ b/lib/helper/Nightmare.js @@ -132,9 +132,9 @@ class Nightmare extends Helper { const typeFn = () => child.call('type', text, done); this.evaluate_now((el, clean) => { - var el = window.codeceptjs.fetchElement(el); - if (clean) el.value = ''; - el.focus(); + const element = window.codeceptjs.fetchElement(el); + if (clean) element.value = ''; + element.focus(); }, () => { if (clean) return typeFn(); child.call('pressKey', 'End', typeFn); // type End before @@ -224,7 +224,7 @@ class Nightmare extends Helper { if (this.options.windowSize) { const size = this.options.windowSize.split('x'); - return this.browser.viewport(parseInt(size[0]), parseInt(size[1])); + return this.browser.viewport(parseInt(size[0], 10), parseInt(size[1], 10)); } }); } @@ -889,8 +889,8 @@ class Nightmare extends Helper { module.exports = Nightmare; function proceedSee(assertType, text, context) { - let description, - locator; + let description; + let locator; if (!context) { if (this.context === this.options.rootElement) { locator = guessLocator(this.context) || { css: this.context }; diff --git a/lib/helper/Protractor.js b/lib/helper/Protractor.js index 1ec47f653..a438fc40b 100644 --- a/lib/helper/Protractor.js +++ b/lib/helper/Protractor.js @@ -146,12 +146,12 @@ class Protractor extends SeleniumWebdriver { global.by = global.By = new By(); global.ExpectedConditions = EC = this.browser.ExpectedConditions; const promisesList = []; - if (this.options.windowSize == 'maximize') { + if (this.options.windowSize === 'maximize') { promisesList.push(this.resizeWindow(this.options.windowSize)); } if (this.options.windowSize) { const size = this.options.windowSize.split('x'); - promisesList.push(this.resizeWindow(parseInt(size[0]), parseInt(size[1]))); + promisesList.push(this.resizeWindow(parseInt(size[0], 10), parseInt(size[1], 10))); } return Promise.all(promisesList).then(() => this.isRunning = true); diff --git a/lib/helper/SeleniumWebdriver.js b/lib/helper/SeleniumWebdriver.js index 4485dcd2c..d8abb83f3 100644 --- a/lib/helper/SeleniumWebdriver.js +++ b/lib/helper/SeleniumWebdriver.js @@ -146,7 +146,7 @@ class SeleniumWebdriver extends Helper { _startBrowser() { this.browser = this.browserBuilder.build(); const promisesList = []; - if (this.options.windowSize == 'maximize') { + if (this.options.windowSize === 'maximize') { promisesList.push(this.resizeWindow(this.options.windowSize)); } else if (this.options.windowSize && this.options.windowSize.indexOf('x') > 0) { const size = this.options.windowSize.split('x'); @@ -189,10 +189,10 @@ class SeleniumWebdriver extends Helper { _failed(test) { const promisesList = []; - if (Object.keys(withinStore).length != 0) promisesList.push(this._withinEnd()); + if (Object.keys(withinStore).length !== 0) promisesList.push(this._withinEnd()); if (!this.options.disableScreenshots) { let fileName = clearString(test.title); - if (test.ctx && test.ctx.test && test.ctx.test.type == 'hook') fileName = clearString(`${test.title}_${test.ctx.test.title}`); + if (test.ctx && test.ctx.test && test.ctx.test.type === 'hook') fileName = clearString(`${test.title}_${test.ctx.test.title}`); if (this.options.uniqueScreenshotNames) { const uuid = test.uuid || test.ctx.test.uuid; fileName = `${fileName.substring(0, 10)}_${uuid}.failed.png`; @@ -204,7 +204,7 @@ class SeleniumWebdriver extends Helper { return Promise.all(promisesList).catch((err) => { if (err && err.type && - err.type == 'RuntimeError' && + err.type === 'RuntimeError' && err.message && (err.message.indexOf('was terminated due to') > -1 || err.message.indexOf('no such window: target window already closed') > -1) ) { @@ -363,7 +363,8 @@ class SeleniumWebdriver extends Helper { */ pressKey(key) { let modifier; - if (Array.isArray(key) && ~['Control', 'Command', 'Shift', 'Alt'].indexOf(key[0])) { + const mofidiers = ['Control', 'Command', 'Shift', 'Alt']; + if (Array.isArray(key) && mofidiers.includes(key[0])) { modifier = this.webdriver.Key[key[0].toUpperCase()]; key = key[1]; } @@ -615,7 +616,7 @@ class SeleniumWebdriver extends Helper { const writeFile = (png, outputFile) => { const fs = require('fs'); const stream = fs.createWriteStream(outputFile); - stream.write(new Buffer(png, 'base64')); + stream.write(Buffer.from(png, 'base64')); stream.end(); return new Promise((resolve => stream.on('finish', resolve))); }; @@ -695,8 +696,8 @@ class SeleniumWebdriver extends Helper { resizeWindow(width, height) { const client = this.browser; if (width === 'maximize') { - return client.executeScript('return [screen.width, screen.height]').then(res => client.manage().window().setSize(parseInt(res[0]), parseInt(res[1]))); - } return client.manage().window().setSize(parseInt(width), parseInt(height)); + return client.executeScript('return [screen.width, screen.height]').then(res => client.manage().window().setSize(parseInt(res[0], 10), parseInt(res[1], 10))); + } return client.manage().window().setSize(parseInt(width, 10), parseInt(height, 10)); } /** @@ -844,8 +845,8 @@ function* findFields(client, locator) { } function proceedSee(assertType, text, context) { - let description, - locator; + let description; + let locator; if (!context) { if (this.context === this.options.rootElement) { locator = guessLocator(this.context) || global.by.css(this.context); @@ -859,7 +860,7 @@ function proceedSee(assertType, text, context) { locator = guessLocator(context) || global.by.css(context); description = `element ${context}`; } - const enableSmartWait = !!this.context && assertType == 'assert'; + const enableSmartWait = !!this.context && assertType === 'assert'; return this._smartWait(() => this.browser.findElements(locator), enableSmartWait).then(co.wrap(function* (els) { const promises = []; let source = ''; @@ -877,7 +878,7 @@ function* proceedSeeInField(assertType, field, value) { const el = els[0]; const tag = yield el.getTagName(); const fieldVal = yield el.getAttribute('value'); - if (tag == 'select') { + if (tag === 'select') { // locate option by values and check them const text = yield el.findElement(global.by.xpath(`./option[@value=${xpathLocator.literal(fieldVal)}]`)).getText(); return equals(`select option by ${field}`)[assertType](value, text); diff --git a/lib/helper/WebDriverIO.js b/lib/helper/WebDriverIO.js index 450c34a5f..724f74188 100644 --- a/lib/helper/WebDriverIO.js +++ b/lib/helper/WebDriverIO.js @@ -358,7 +358,7 @@ class WebDriverIO extends Helper { return Promise.all(promisesList).catch((err) => { if (err && err.type && - err.type == 'RuntimeError' && + err.type === 'RuntimeError' && err.message && (err.message.indexOf('was terminated due to') > -1 || err.message.indexOf('no such window: target window already closed') > -1) ) { @@ -588,8 +588,8 @@ class WebDriverIO extends Helper { } const elem = res.value[0]; - let normalized, - byVisibleText; + let normalized; + let byVisibleText; let commands = []; if (!Array.isArray(option)) { @@ -614,8 +614,8 @@ class WebDriverIO extends Helper { els.forEach(clickOptionFn); return this.browser.unify(commands); } - let normalized, - byValue; + let normalized; + let byValue; option.forEach((opt) => { normalized = `[normalize-space(@value) = "${opt.trim()}"]`; @@ -1349,7 +1349,8 @@ class WebDriverIO extends Helper { */ pressKey(key) { let modifier; - if (Array.isArray(key) && ~['Control', 'Command', 'Shift', 'Alt'].indexOf(key[0])) { + const mofidiers = ['Control', 'Command', 'Shift', 'Alt']; + if (Array.isArray(key) && mofidiers.includes(key[0])) { modifier = key[0]; } return this.browser.keys(key).then(function () { @@ -1861,8 +1862,8 @@ class WebDriverIO extends Helper { scrollPageToBottom() { const client = this.browser; return client.execute(() => { - let body = document.body, - html = document.documentElement; + const body = document.body; + const html = document.documentElement; window.scrollTo(0, Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight, @@ -1943,10 +1944,6 @@ function findClickable(locator, locateFn) { }); } -function toStrictLocator(locator) { - if (locator[0] == '#') return; -} - function findFields(locator) { if (typeof locator === 'object' || locator[0] === '~') return this._locate(withStrictLocator.call(this, locator), true); if (isCSSorXPathLocator(locator)) return this._locate(locator, true); diff --git a/lib/interfaces/bdd.js b/lib/interfaces/bdd.js index 2afb6b80e..5cc784590 100644 --- a/lib/interfaces/bdd.js +++ b/lib/interfaces/bdd.js @@ -24,10 +24,10 @@ const addDataContext = require('../data/context'); module.exports = function (suite) { const suites = [suite]; suite.timeout(0); - let afterAllHooks, - afterEachHooks, - afterAllHooksAreLoaded, - afterEachHooksAreLoaded; + let afterAllHooks; + let afterEachHooks; + let afterAllHooksAreLoaded; + let afterEachHooksAreLoaded; suite.on('pre-require', (context, file, mocha) => { const common = require('mocha/lib/interfaces/common')(suites, context); diff --git a/lib/pause.js b/lib/pause.js index cf327393e..34c60ce5e 100644 --- a/lib/pause.js +++ b/lib/pause.js @@ -42,7 +42,7 @@ function parseInput(cmd) { } try { const I = container.support('I'); - eval(`I.${cmd}`); + eval(`I.${cmd}`); // eslint-disable-line no-eval } catch (err) { output.print(output.styles.error(' ERROR '), err.message); } diff --git a/lib/scenario.js b/lib/scenario.js index 4510b1a22..304fe04b9 100644 --- a/lib/scenario.js +++ b/lib/scenario.js @@ -5,7 +5,7 @@ const getParamNames = require('./utils').getParamNames; const isGenerator = require('./utils').isGenerator; -var resumeTest = module.exports.resumeTest = function (res, done, error, returnStatement) { +const resumeTest = function (res, done, error, returnStatement) { recorder.add('create new promises queue for generator', (data) => { recorder.session.start('generator'); // creating a new promise chain try { @@ -25,6 +25,8 @@ var resumeTest = module.exports.resumeTest = function (res, done, error, returnS }); }; +module.exports.resumeTest = resumeTest; + const injectHook = function (inject, suite) { try { inject(); diff --git a/lib/utils.js b/lib/utils.js index e59acd143..d5543b4e4 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -85,13 +85,15 @@ module.exports.methodsOfObject = function (obj, className) { 'propertyIsEnumerable', ]; + function pushToMethods(prop) { + if (typeof obj[prop] !== 'function') return; + if (standard.indexOf(prop) >= 0) return; + if (prop.indexOf('_') === 0) return; + methods.push(prop); + } + while (obj.constructor.name !== className) { - Object.getOwnPropertyNames(obj).forEach((prop) => { - if (typeof obj[prop] !== 'function') return; - if (standard.indexOf(prop) >= 0) return; - if (prop.indexOf('_') === 0) return; - methods.push(prop); - }); + Object.getOwnPropertyNames(obj).forEach(pushToMethods); obj = Object.getPrototypeOf(obj); if (!obj || !obj.constructor) break; diff --git a/test/data/rest/headers.js b/test/data/rest/headers.js index 5903e7df7..708eda0be 100644 --- a/test/data/rest/headers.js +++ b/test/data/rest/headers.js @@ -1,4 +1,4 @@ module.exports = (req, res, next) => { - if (req.path != '/headers') return next(); + if (req.path !== '/headers') return next(); res.json(req.headers); }; diff --git a/test/data/sandbox/config.js b/test/data/sandbox/config.js index 6471d39fa..460dea48c 100644 --- a/test/data/sandbox/config.js +++ b/test/data/sandbox/config.js @@ -13,10 +13,10 @@ exports.config = { name: 'sandbox', }; -if (profile == 'failed') { +if (profile === 'failed') { exports.config.tests = './*_test_failed.js'; } -if (profile == 'bootstrap') { +if (profile === 'bootstrap') { exports.config.bootstrap = 'hooks.js'; } diff --git a/test/data/sandbox/within_helper.js b/test/data/sandbox/within_helper.js index a6cecbb21..faabe3c0d 100644 --- a/test/data/sandbox/within_helper.js +++ b/test/data/sandbox/within_helper.js @@ -16,7 +16,7 @@ class Whithin extends Helper { } smallYield() { - return `I am small yield string`; + return 'I am small yield string'; } smallPromise() { diff --git a/test/helper/Nightmare_test.js b/test/helper/Nightmare_test.js index dbc219324..56790f637 100644 --- a/test/helper/Nightmare_test.js +++ b/test/helper/Nightmare_test.js @@ -20,7 +20,9 @@ describe('Nightmare', function () { global.codecept_dir = path.join(__dirname, '/../data'); try { fs.unlinkSync(dataFile); - } catch (err) {} + } catch (err) { + // continue regardless of error + } I = new Nightmare({ url: site_url, diff --git a/test/helper/SeleniumWebdriver_test.js b/test/helper/SeleniumWebdriver_test.js index 405ec1d75..4be469b41 100644 --- a/test/helper/SeleniumWebdriver_test.js +++ b/test/helper/SeleniumWebdriver_test.js @@ -22,7 +22,9 @@ describe('SeleniumWebdriver', function () { global.codecept_dir = path.join(__dirname, '/../data'); try { fs.unlinkSync(dataFile); - } catch (err) {} + } catch (err) { + // continue regardless of error + } I = new SeleniumWebdriver({ url: site_url, diff --git a/test/helper/WebDriverIO_test.js b/test/helper/WebDriverIO_test.js index 506d56f0f..43cb4f69d 100644 --- a/test/helper/WebDriverIO_test.js +++ b/test/helper/WebDriverIO_test.js @@ -19,7 +19,9 @@ describe('WebDriverIO', function () { global.codecept_dir = path.join(__dirname, '/../data'); try { fs.unlinkSync(dataFile); - } catch (err) {} + } catch (err) { + // continue regardless of error + } wd = new WebDriverIO({ url: site_url, diff --git a/test/rest/ApiDataFactory_test.js b/test/rest/ApiDataFactory_test.js index 61f4ed2aa..fc4fc0e39 100644 --- a/test/rest/ApiDataFactory_test.js +++ b/test/rest/ApiDataFactory_test.js @@ -40,7 +40,9 @@ describe('ApiDataFactory', () => { beforeEach((done) => { try { fs.writeFileSync(dbFile, JSON.stringify(data)); - } catch (err) {} + } catch (err) { + // continue regardless of error + } setTimeout(done, 500); }); diff --git a/test/rest/REST_test.js b/test/rest/REST_test.js index d1d25928c..cf480ed14 100644 --- a/test/rest/REST_test.js +++ b/test/rest/REST_test.js @@ -35,7 +35,9 @@ describe('REST', () => { beforeEach((done) => { try { fs.writeFileSync(dbFile, JSON.stringify(data)); - } catch (err) {} + } catch (err) { + // continue regardless of error + } setTimeout(done, 700); }); diff --git a/test/runner/list_test.js b/test/runner/list_test.js index 3390e9a94..3d8aaa7c4 100644 --- a/test/runner/list_test.js +++ b/test/runner/list_test.js @@ -19,7 +19,9 @@ describe('list/def commands', () => { it('def should create definition file', (done) => { try { require('fs').unlinkSync(`${codecept_dir}/steps.d.ts`); - } catch (e) {} + } catch (e) { + // continue regardless of error + } exec(`${runner} def ${codecept_dir}`, (err, stdout, stderr) => { stdout.should.include('Definitions were generated in steps.d.ts'); stdout.should.include(''); diff --git a/test/runner/within_test.js b/test/runner/within_test.js index 3e909b43f..390234a9b 100644 --- a/test/runner/within_test.js +++ b/test/runner/within_test.js @@ -6,8 +6,8 @@ const codecept_dir = path.join(__dirname, '/../data/sandbox'); const codecept_run = `${runner} run --config ${codecept_dir}/codecept.within.json `; const getLines = function (array, startString, endString) { - let startIndex, - endIndex; + let startIndex; + let endIndex; array.every((elem, index) => { if (elem === startString) { startIndex = index; diff --git a/test/unit/steps_test.js b/test/unit/steps_test.js index c9da1abd6..c5a460c0b 100644 --- a/test/unit/steps_test.js +++ b/test/unit/steps_test.js @@ -46,11 +46,6 @@ describe('Step', () => { }); describe('#run', () => { - let init, - before, - after, - failed; - afterEach(() => event.cleanDispatcher()); it('should run step', () => {