Skip to content

Commit

Permalink
feat: add execution url
Browse files Browse the repository at this point in the history
  • Loading branch information
wswebcreation committed Oct 25, 2020
1 parent 517b60a commit eb8dc10
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
sauce_connect.log
npm-debug.log
dist/

.idea/
17 changes: 17 additions & 0 deletions src/reporter/reporter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import {BrowserMap} from "../browser-info";
import SaucelabsAPI, {Job} from 'saucelabs';

const REGION_MAPPING = {
'us': '', // default endpoint
'eu': 'eu-central-1.',
};

/**
* Get the Sauce Labs endpoint
* @param region
*/
function getSauceEndpoint (region) {
const shortRegion = REGION_MAPPING[region] ? region : 'us'

return `https://app.${REGION_MAPPING[shortRegion]}saucelabs.com/tests/`
}

/**
* Karma browser reported that updates corresponding Saucelabs jobs whenever a given
* browser finishes.
Expand Down Expand Up @@ -60,6 +75,8 @@ export function SaucelabsReporter(logger, browserMap: BrowserMap) {
passed: hasPassed,
'custom-data': result
}));

log.info(`Check out job at ${getSauceEndpoint(browserData.region)}${sessionId}`)
};

// Whenever this method is being called, we just need to wait for all API calls to finish,
Expand Down

0 comments on commit eb8dc10

Please sign in to comment.