@wdio/runner
Advanced tools
Comparing version 5.4.19 to 5.4.20
@@ -18,2 +18,4 @@ "use strict"; | ||
var _utils = require("@wdio/utils"); | ||
var _config = require("@wdio/config"); | ||
@@ -23,3 +25,3 @@ | ||
var _utils = require("./utils"); | ||
var _utils2 = require("./utils"); | ||
@@ -86,3 +88,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
this.inWatchMode = Boolean(this.config.watch); | ||
await (0, _utils.runHook)('beforeSession', this.config, this.caps, this.specs); | ||
await (0, _utils2.runHook)('beforeSession', this.config, this.caps, this.specs); | ||
const browser = await this._initSession(this.config, this.caps); | ||
@@ -113,3 +115,3 @@ /** | ||
this.framework = (0, _config.initialisePlugin)(this.config.framework, 'framework'); | ||
this.framework = (0, _utils.initialisePlugin)(this.config.framework, 'framework'); | ||
/** | ||
@@ -201,3 +203,3 @@ * initialisation successful, send start message | ||
try { | ||
browser = global.browser = global.driver = await (0, _utils.initialiseInstance)(config, caps, this.isMultiremote); | ||
browser = global.browser = global.driver = await (0, _utils2.initialiseInstance)(config, caps, this.isMultiremote); | ||
} catch (e) { | ||
@@ -319,3 +321,3 @@ log.error(e); | ||
delete global.browser.sessionId; | ||
await (0, _utils.runHook)('afterSession', global.browser.config, this.caps, this.specs); | ||
await (0, _utils2.runHook)('afterSession', global.browser.config, this.caps, this.specs); | ||
@@ -322,0 +324,0 @@ if (shutdown) { |
@@ -12,3 +12,3 @@ "use strict"; | ||
var _config = require("@wdio/config"); | ||
var _utils = require("@wdio/utils"); | ||
@@ -190,3 +190,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
if (typeof reporter === 'string') { | ||
ReporterClass = (0, _config.initialisePlugin)(reporter, 'reporter'); | ||
ReporterClass = (0, _utils.initialisePlugin)(reporter, 'reporter'); | ||
const customLogFile = options.setLogFile(this.cid, reporter); | ||
@@ -193,0 +193,0 @@ options.logFile = customLogFile || this.getLogFile(reporter); |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.runHook = runHook; | ||
exports.initialiseServices = initialiseServices; | ||
exports.sanitizeCaps = sanitizeCaps; | ||
@@ -47,65 +46,2 @@ exports.initialiseInstance = initialiseInstance; | ||
/** | ||
* initialise services based on configuration | ||
* @param {Object} config of running session | ||
* @return {Object[]} list of service classes that got initialised | ||
*/ | ||
function initialiseServices(config, caps) { | ||
const initialisedServices = []; | ||
if (!Array.isArray(config.services)) { | ||
return initialisedServices; | ||
} | ||
for (let serviceName of config.services) { | ||
let serviceConfig = config; | ||
/** | ||
* allow custom services that are already initialised | ||
*/ | ||
if (typeof serviceName === 'object' && !Array.isArray(serviceName)) { | ||
log.debug('initialise custom initiated service'); | ||
initialisedServices.push(serviceName); | ||
continue; | ||
} | ||
/** | ||
* allow custom services with custom options | ||
*/ | ||
if (Array.isArray(serviceName)) { | ||
serviceConfig = (0, _deepmerge.default)(config, serviceName[1] || {}); | ||
serviceName = serviceName[0]; | ||
} | ||
try { | ||
/** | ||
* allow custom service classes | ||
*/ | ||
if (typeof serviceName === 'function') { | ||
log.debug(`initialise custom service "${serviceName.name}"`); | ||
initialisedServices.push(new serviceName(serviceConfig, caps)); | ||
continue; | ||
} | ||
log.debug(`initialise wdio service "${serviceName}"`); | ||
const Service = (0, _config.initialisePlugin)(serviceName, 'service'); | ||
/** | ||
* service only contains a launcher | ||
*/ | ||
if (!Service) { | ||
continue; | ||
} | ||
initialisedServices.push(new Service(serviceConfig, caps)); | ||
} catch (e) { | ||
log.error(e); | ||
} | ||
} | ||
return initialisedServices; | ||
} | ||
/** | ||
* sanitizes wdio config from capability properties | ||
@@ -112,0 +48,0 @@ * @param {Object} caps desired session capabilities |
{ | ||
"name": "@wdio/runner", | ||
"version": "5.4.19", | ||
"version": "5.4.20", | ||
"description": "A WebdriverIO service that runs tests in arbitrary environments", | ||
@@ -33,7 +33,8 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
"dependencies": { | ||
"@wdio/config": "^5.4.18", | ||
"@wdio/config": "^5.4.20", | ||
"@wdio/logger": "^5.4.6", | ||
"@wdio/utils": "^5.4.20", | ||
"deepmerge": "^2.0.1", | ||
"gaze": "^1.1.2", | ||
"webdriverio": "^5.4.19" | ||
"webdriverio": "^5.4.20" | ||
}, | ||
@@ -43,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4c8c0d0c27d5588d7e4d2bfd967fa0c019e9b523" | ||
"gitHead": "9ea8e0f3e62d132a12eec8978bcba4eb8658fb81" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18185
6
509
+ Added@wdio/utils@^5.4.20
Updated@wdio/config@^5.4.20
Updatedwebdriverio@^5.4.20