Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix reporter with browsers not launched through launcher #233

Merged
merged 1 commit into from Nov 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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