@wdio/cli 5.12.0 → 5.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,7 @@ class WDIOCLInterface extends _events.default {
27
27
  this.isWatchMode = isWatchMode;
28
28
  this.inDebugMode = false;
29
29
  this.specFileRetries = config.specFileRetries || 0;
30
+ this.endedNormally = false;
30
31
  this.on('job:start', this.addJob.bind(this));
31
32
  this.on('job:end', this.clearJob.bind(this));
32
33
  this.setup();
@@ -193,7 +194,7 @@ class WDIOCLInterface extends _events.default {
193
194
  }
194
195
 
195
196
  sigintTrigger() {
196
- if (this.inDebugMode) {
197
+ if (this.inDebugMode || this.endedNormally) {
197
198
  return false;
198
199
  }
199
200
 
@@ -226,6 +227,7 @@ class WDIOCLInterface extends _events.default {
226
227
  return;
227
228
  }
228
229
 
230
+ this.endedNormally = true;
229
231
  this.printReporters();
230
232
  this.printSummary();
231
233
  }
package/build/launcher.js CHANGED
@@ -60,22 +60,33 @@ class Launcher {
60
60
  }
61
61
 
62
62
  async run() {
63
- let config = this.configParser.getConfig();
64
- let caps = this.configParser.getCapabilities();
65
- const launcher = (0, _utils.initialiseServices)(config, caps, 'launcher');
66
- await this.runner.initialise();
67
- log.info('Run onPrepare hook');
68
- await (0, _utils2.runOnPrepareHook)(config.onPrepare, config, caps);
69
- await (0, _utils2.runServiceHook)(launcher, 'onPrepare', config, caps);
70
63
  (0, _asyncExitHook.default)(this.exitHandler.bind(this));
71
- let exitCode = await this.runMode(config, caps);
72
- log.info('Run onComplete hook');
73
- await (0, _utils2.runServiceHook)(launcher, 'onComplete', exitCode, config, caps);
74
- const onCompleteResults = await (0, _utils2.runOnCompleteHook)(config.onComplete, config, caps, exitCode, this.interface.result);
75
- exitCode = onCompleteResults.includes(1) ? 1 : exitCode;
76
- await _logger.default.waitForBuffer();
77
- this.interface.finalise();
78
- return exitCode;
64
+ let exitCode;
65
+ let onCompleteResults;
66
+
67
+ try {
68
+ const config = this.configParser.getConfig();
69
+ const caps = this.configParser.getCapabilities();
70
+ const launcher = (0, _utils.initialiseServices)(config, caps, 'launcher');
71
+ await this.runner.initialise();
72
+ log.info('Run onPrepare hook');
73
+ await (0, _utils2.runOnPrepareHook)(config.onPrepare, config, caps);
74
+ await (0, _utils2.runServiceHook)(launcher, 'onPrepare', config, caps);
75
+ exitCode = await this.runMode(config, caps);
76
+ log.info('Run onComplete hook');
77
+ await (0, _utils2.runServiceHook)(launcher, 'onComplete', exitCode, config, caps);
78
+ onCompleteResults = await (0, _utils2.runOnCompleteHook)(config.onComplete, config, caps, exitCode, this.interface.result);
79
+ exitCode = onCompleteResults.includes(1) ? 1 : exitCode;
80
+ await _logger.default.waitForBuffer();
81
+ this.interface.finalise();
82
+ return exitCode;
83
+ } catch (err) {
84
+ if (!onCompleteResults) {
85
+ process.emit('shutdown', 1);
86
+ }
87
+
88
+ throw err;
89
+ }
79
90
  }
80
91
 
81
92
  runMode(config, caps) {
package/build/run.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = run;
7
+ exports.launch = launch;
7
8
 
8
9
  var _fs = _interopRequireDefault(require("fs"));
9
10
 
@@ -60,7 +61,5 @@ function run(params) {
60
61
 
61
62
  function launch(wdioConf, params) {
62
63
  const launcher = new _launcher.default(wdioConf, params);
63
- launcher.run().then(code => process.nextTick(() => process.exit(code)), e => process.nextTick(() => {
64
- throw e;
65
- }));
64
+ return launcher.run();
66
65
  }
package/build/setup.js CHANGED
@@ -21,6 +21,12 @@ var _utils = require("./utils");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
25
+
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
27
+
28
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
+
24
30
  async function setup(exit = true) {
25
31
  try {
26
32
  console.log(_config.CONFIG_HELPER_INTRO);
@@ -43,13 +49,15 @@ async function setup(exit = true) {
43
49
  }
44
50
 
45
51
  console.log('\nPackages installed successfully, creating configuration file...');
46
- const parsedAnswers = { ...answers,
52
+
53
+ const parsedAnswers = _objectSpread({}, answers, {
47
54
  runner: (0, _utils.getPackageName)(answers.runner),
48
55
  framework: (0, _utils.getPackageName)(answers.framework),
49
56
  reporters: answers.reporters.map(_utils.getPackageName),
50
57
  services: answers.services.map(_utils.getPackageName),
51
58
  packagesToInstall
52
- };
59
+ });
60
+
53
61
  renderConfigurationFile(parsedAnswers);
54
62
 
55
63
  if (exit) {
@@ -305,22 +305,22 @@ exports.config = {
305
305
  /**
306
306
  * Runs before a Cucumber feature
307
307
  */
308
- // beforeFeature: function (uri, feature) {
308
+ // beforeFeature: function (uri, feature, scenarios) {
309
309
  // },
310
310
  /**
311
311
  * Runs before a Cucumber scenario
312
312
  */
313
- // beforeScenario: function (uri, feature, scenario) {
313
+ // beforeScenario: function (uri, feature, scenario, sourceLocation) {
314
314
  // },
315
315
  /**
316
316
  * Runs before a Cucumber step
317
317
  */
318
- // beforeStep: function (uri, feature, scenario, step, sourceLocation) {
318
+ // beforeStep: function (uri, feature) {
319
319
  // },
320
320
  /**
321
321
  * Runs after a Cucumber step
322
322
  */
323
- // afterStep: function (uri, feature, scenario, step, result, sourceLocation) {
323
+ // afterStep: function (uri, feature, { error, result }) {
324
324
  // },
325
325
  /**
326
326
  * Runs after a Cucumber scenario
@@ -330,7 +330,7 @@ exports.config = {
330
330
  /**
331
331
  * Runs after a Cucumber feature
332
332
  */
333
- // afterFeature: function (uri, feature) {
333
+ // afterFeature: function (uri, feature, scenarios) {
334
334
  // },
335
335
  <% } %>
336
336
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/cli",
3
- "version": "5.12.0",
3
+ "version": "5.12.1",
4
4
  "description": "WebdriverIO testrunner command line interface",
5
5
  "author": "Christian Bromann <christian@saucelabs.com>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-cli",
@@ -10,7 +10,7 @@
10
10
  "wdio": "./bin/wdio.js"
11
11
  },
12
12
  "engines": {
13
- "node": ">= 10.13.0"
13
+ "node": ">= 8.11.0"
14
14
  },
15
15
  "scripts": {
16
16
  "build": "run-s clean compile copy",
@@ -35,9 +35,9 @@
35
35
  "url": "https://github.com/webdriverio/webdriverio/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@wdio/config": "^5.12.0",
39
- "@wdio/logger": "^5.12.0",
40
- "@wdio/utils": "^5.12.0",
38
+ "@wdio/config": "^5.12.1",
39
+ "@wdio/logger": "^5.12.1",
40
+ "@wdio/utils": "^5.12.1",
41
41
  "async-exit-hook": "^2.0.1",
42
42
  "chalk": "^2.3.2",
43
43
  "chokidar": "^3.0.0",
@@ -50,12 +50,12 @@
50
50
  "lodash.pickby": "^4.6.0",
51
51
  "lodash.union": "^4.6.0",
52
52
  "log-update": "^3.2.0",
53
- "webdriverio": "^5.12.0",
53
+ "webdriverio": "^5.12.1",
54
54
  "yargs": "^13.2.4",
55
55
  "yarn-install": "^1.0.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "187c8f044e252877533e53ee2b645f56416d5a41"
60
+ "gitHead": "848151e5fdcb8b694c1a273b9b69852c22875687"
61
61
  }