Skip to content

Commit 0c978a6

Browse files
committed
changes for logging session URL
1 parent e832241 commit 0c978a6

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wdio-lambdatest-service",
3-
"version": "2.1.3",
3+
"version": "3.0.0",
44
"description": "A WebdriverIO service that manages tunnel and job metadata for LambdaTest.",
55
"author": "LambdaTest <[email protected]>",
66
"contributors": [

src/service.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,21 @@ export default class LambdaRestService {
241241

242242
if (!this._browser.isMultiremote) {
243243
log.info(`Update job with sessionId ${this._browser.sessionId}, ${status}`);
244+
245+
// Print session URL for single remote browser
246+
const sessionURL = this.getSessionURL(this._browser.sessionId, this._config.product);
247+
log.info(`Session URL: ${sessionURL}`);
248+
244249
return this._update({ sessionId: this._browser.sessionId, failures: result });
245250
}
246251

247252
return Promise.all(Object.keys(this._capabilities).map(browserName => {
248253
log.info(`Update multiremote job for browser '${browserName}' and sessionId ${this._browser[browserName].sessionId}, ${status}`);
254+
255+
// Print session URL for each remote browser
256+
const sessionURL = this.getSessionURL(this._browser[browserName].sessionId, this._config.product);
257+
log.info(`Session URL for ${browserName}: ${sessionURL}`);
258+
249259
return this._update({ sessionId: this._browser[browserName].sessionId, failures: failures, calledOnReload: false, browserName: browserName });
250260
}));
251261
}
@@ -260,11 +270,20 @@ export default class LambdaRestService {
260270
if (!this._browser.isMultiremote) {
261271
log.info(`Update (reloaded) job with sessionId ${oldSessionId}, ${status}`);
262272

273+
// Print session URL for single remote browser
274+
const sessionURL = this.getSessionURL(this._browser.sessionId, this._config.product);
275+
log.info(`Session URL: ${sessionURL}`);
276+
263277
await this._update({ sessionId: oldSessionId, fullTitle: this._currentTestTitle, status: status, calledOnReload: true });
264278

265279
} else {
266280
const browserName = this._browser.instances.filter(browserName => this._browser[browserName].sessionId === newSessionId)[0];
267281
log.info(`Update (reloaded) multiremote job for browser '${browserName}' and sessionId ${oldSessionId}, ${status}`);
282+
283+
// Print session URL for each remote browser
284+
const sessionURL = this.getSessionURL(this._browser[browserName].sessionId, this._config.product);
285+
log.info(`Session URL for ${browserName}: ${sessionURL}`);
286+
268287
await this._update({ sessionId : oldSessionId, failures:this._failures, calledOnReload: true, browserName: browserName });
269288
}
270289

@@ -393,4 +412,11 @@ export default class LambdaRestService {
393412
}
394413
return await this._browser.execute(cmd);
395414
}
415+
416+
getSessionURL(sessionId, product) {
417+
if (product === 'appAutomation') {
418+
return `https://appautomation.lambdatest.com/test?testID=${sessionId}`;
419+
}
420+
return `https://automation.lambdatest.com/test?testID=${sessionId}`;
421+
}
396422
}

0 commit comments

Comments
 (0)