diff --git a/src/lib/cli-util.js b/src/lib/cli-util.js index 3c658d5a..0afcb87a 100644 --- a/src/lib/cli-util.js +++ b/src/lib/cli-util.js @@ -148,6 +148,7 @@ export function getConfigurations(target, argv) { appiumUrl : 'http://localhost:4723/wd/hub', reopenSession: false, reRunOnFailed: false, + reRunOnFailedWaitUntil: false, iterations : 1, debugPort: null, delay: null, diff --git a/src/ox_reporters/reporter-xml.js b/src/ox_reporters/reporter-xml.js index da55f762..130bc4b2 100644 --- a/src/ox_reporters/reporter-xml.js +++ b/src/ox_reporters/reporter-xml.js @@ -57,6 +57,7 @@ export default class XmlReporter extends FileReporterBase { appiumUrl: result.options.appiumUrl, reopenSession: result.options.reopenSession, reRunOnFailed: result.options.reRunOnFailed, + reRunOnFailedWaitUntil: result.options.reRunOnFailedWaitUntil, iterations: result.options.iterations, debugPort: result.options.debugPort, delay: result.options.delay, diff --git a/src/runners/oxygen/index.js b/src/runners/oxygen/index.js index 11b589fc..da432ca9 100644 --- a/src/runners/oxygen/index.js +++ b/src/runners/oxygen/index.js @@ -16,7 +16,7 @@ import { EventEmitter } from 'events'; import _ from 'lodash'; import { defer } from 'when'; import path from 'path'; - +import deasync from 'deasync'; import TestSuiteResult from '../../model/suite-result'; import TestCaseResult from '../../model/case-result'; import TestResult from '../../model/test-result'; @@ -445,6 +445,10 @@ export default class OxygenRunner extends EventEmitter { } if (caseResult.status === Status.FAILED && this._options.reRunOnFailed && reRunCount === 0) { + if (this._options.reRunOnFailedWaitUntil) { + deasync.sleep(this._options.reRunOnFailedWaitUntil * 1000); + } + reRunCount = 1; // failed on canceled status not close browser window await (this._worker && this._worker_DisposeModules('passed'));