Skip to content

Commit eb8dc10

Browse files
committed
feat: add execution url
1 parent 517b60a commit eb8dc10

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_modules
22
sauce_connect.log
33
npm-debug.log
44
dist/
5+
6+
.idea/

src/reporter/reporter.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
import {BrowserMap} from "../browser-info";
22
import SaucelabsAPI, {Job} from 'saucelabs';
33

4+
const REGION_MAPPING = {
5+
'us': '', // default endpoint
6+
'eu': 'eu-central-1.',
7+
};
8+
9+
/**
10+
* Get the Sauce Labs endpoint
11+
* @param region
12+
*/
13+
function getSauceEndpoint (region) {
14+
const shortRegion = REGION_MAPPING[region] ? region : 'us'
15+
16+
return `https://app.${REGION_MAPPING[shortRegion]}saucelabs.com/tests/`
17+
}
18+
419
/**
520
* Karma browser reported that updates corresponding Saucelabs jobs whenever a given
621
* browser finishes.
@@ -60,6 +75,8 @@ export function SaucelabsReporter(logger, browserMap: BrowserMap) {
6075
passed: hasPassed,
6176
'custom-data': result
6277
}));
78+
79+
log.info(`Check out job at ${getSauceEndpoint(browserData.region)}${sessionId}`)
6380
};
6481

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

0 commit comments

Comments
 (0)