Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

stash #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions lib/sauce-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,30 @@ class SauceService {
/**
* update Sauce Labs job
*/
after () {
after (result) {
if (!this.sauceUser || !this.sauceKey) {
return
}
let failures = this.failures

return this.updateJob(this.sessionId, this.failures)
/**
* set failures if user has bail option set in which case afterTest and
* afterSuite aren't executed before after hook
*/
if (global.browser.config.mochaOpts && global.browser.config.mochaOpts.bail && Boolean(result)) {
failures = 1
}

// const status = 'status: ' + (failures > 0 ? 'failing' : 'passing')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what do about the logging methods as that was not previously done here in this service it looks like?

if (!global.browser.isMultiremote) {
// log.info(`Update job with sessionId ${global.browser.sessionId}, ${status}`)
return this.updateJob(global.browser.sessionId, failures)
}

return Promise.all(Object.keys(this.capabilities).map((browserName) => {
// log.info(`Update multiremote job for browser "${browserName}" and sessionId ${global.browser[browserName].sessionId}, ${status}`)
return this.updateJob(global.browser[browserName].sessionId, failures, false, browserName)
}))
}

onReload (oldSessionId, newSessionId) {
Expand Down