Skip to content

Commit

Permalink
Execute beforeSession hook before everything is initiated (#6122)
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Nov 17, 2020
1 parent 6f7a0c9 commit c50b973
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/wdio-runner/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ export default class Runner extends EventEmitter {
logger.setLogLevelsConfig(this.config.logLevels, this.config.logLevel)
const isMultiremote = this.isMultiremote = !Array.isArray(this.configParser.getCapabilities())

/**
* run `beforeSession` command before framework and browser are initiated
*/
initialiseWorkerService(this.config, caps, args.ignoredWorkerServices)
.map(this.configParser.addService.bind(this.configParser))
await runHook('beforeSession', this.config, this.caps, this.specs)

/**
* create `browser` stub only if `specFiltering` feature is enabled
*/
Expand All @@ -73,12 +80,7 @@ export default class Runner extends EventEmitter {
return this._shutdown(0)
}

initialiseWorkerService(this.config, caps, args.ignoredWorkerServices)
.map(this.configParser.addService.bind(this.configParser))

await runHook('beforeSession', this.config, this.caps, this.specs)
browser = await this._initSession(this.config, this.caps, browser)

this.inWatchMode = Boolean(this.config.watch)

/**
Expand Down

0 comments on commit c50b973

Please sign in to comment.