diff --git a/.gitignore b/.gitignore index 6c4db4a..c7103c4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules sauce_connect.log npm-debug.log dist/ + +.idea/ diff --git a/src/reporter/reporter.ts b/src/reporter/reporter.ts index 9cf53f9..19e7e46 100644 --- a/src/reporter/reporter.ts +++ b/src/reporter/reporter.ts @@ -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. @@ -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,