Skip to content

Commit

Permalink
fix: fix reporter with browsers not launched through launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Nov 29, 2020
1 parent 1d4d623 commit 39943d7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/reporter/reporter.ts
Expand Up @@ -28,16 +28,25 @@ export function SaucelabsReporter(logger, browserMap: BrowserMap) {
// This fires when a single test is executed and will update the run in sauce labs with an annotation
// of the test including the status of the test
this.onSpecComplete = function (browser, result) {
const browserId = browser.id;
const browserData = browserMap.get(browserId);

// Do nothing if the current browser has not been launched through the Saucelabs
// launcher.
if (!browserData) {
return;
}

const status = result.success ? '✅' : '❌'

browserMap.get(browser.id).results.push({
browserData.results.push({
status: 'info',
message: `${status} ${result.fullName}`,
screenshot: null
})

if (!result.success && result.log.length > 0) {
browserMap.get(browser.id).results.push({
browserData.results.push({
status: 'info',
message: `${result.log[0]}`,
screenshot: null
Expand Down

0 comments on commit 39943d7

Please sign in to comment.