Skip to content

Commit 5fdf3dd

Browse files
author
Kanhaiya Lal Singh
committed
Update session name if not in capabilities #6
1 parent 0a897e0 commit 5fdf3dd

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

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": "1.0.1",
3+
"version": "1.0.2",
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: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,19 @@ export default class LambdaRestService {
146146
/* istanbul ignore next */
147147
getBody(failures, calledOnReload = false, browserName) {
148148
let body = {}
149-
body.name = this.suiteTitle
150-
if (browserName) {
151-
body.name = `${browserName}: ${body.name}`
152-
}
153-
if (calledOnReload || this.testCnt) {
154-
let testCnt = ++this.testCnt
155-
if (global.browser.isMultiremote) {
156-
testCnt = Math.ceil(testCnt / global.browser.instances.length)
149+
if (!(!global.browser.isMultiremote && this.capabilities.name || global.browser.isMultiremote && this.capabilities[browserName].capabilities.name)) {
150+
body.name = this.suiteTitle
151+
if (browserName) {
152+
body.name = `${browserName}: ${body.name}`
157153
}
154+
if (calledOnReload || this.testCnt) {
155+
let testCnt = ++this.testCnt
156+
if (global.browser.isMultiremote) {
157+
testCnt = Math.ceil(testCnt / global.browser.instances.length)
158+
}
158159

159-
body.name += ` (${testCnt})`
160+
body.name += ` (${testCnt})`
161+
}
160162
}
161163
body.status_ind = failures > 0 ? 'failed' : 'passed'
162164
return body

0 commit comments

Comments
 (0)