diff --git a/lib/interfaces/scenarioConfig.js b/lib/interfaces/scenarioConfig.js index 589ea1cfb..cf9910f18 100644 --- a/lib/interfaces/scenarioConfig.js +++ b/lib/interfaces/scenarioConfig.js @@ -35,6 +35,7 @@ class ScenarioConfig { * @returns {this} */ retry(retries) { + if (process.env.SCENARIO_ONLY) retries = -retries; this.test.retries(retries); return this; } diff --git a/lib/ui.js b/lib/ui.js index b142a467a..2cc8ef305 100644 --- a/lib/ui.js +++ b/lib/ui.js @@ -168,6 +168,7 @@ module.exports = function (suite) { context.Scenario.only = function (title, opts, fn) { const reString = `^${escapeRe(`${suites[0].title}: ${title}`.replace(/( \| {.+})?$/g, ''))}`; mocha.grep(new RegExp(reString)); + process.env.SCENARIO_ONLY = true; return addScenario(title, opts, fn); };