Skip to content

Commit 060bb43

Browse files
Merge pull request #32 from Shivanshu-lambdatest/master
Added Support for App automation
2 parents 3184661 + 943be42 commit 060bb43

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wdio-lambdatest-service",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "A WebdriverIO service that manages tunnel and job metadata for LambdaTest.",
55
"author": "LambdaTest <[email protected]>",
66
"contributors": [
@@ -34,8 +34,8 @@
3434
"url": "https://github.com/LambdaTest/wdio-lambdatest-service/issues"
3535
},
3636
"dependencies": {
37-
"@lambdatest/node-rest-client": "*",
38-
"@lambdatest/node-tunnel": "*",
37+
"@lambdatest/node-rest-client": "^1.0.3",
38+
"@lambdatest/node-tunnel": "^3.0.7",
3939
"@wdio/logger": "6.0.0-alpha.0",
4040
"source-map-support": "^0.5.16"
4141
},

src/service.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ export default class LambdaRestService {
1414
this.capabilities = capabilities;
1515
const lambdaCredentials = {
1616
username: this.config.user,
17-
accessKey: this.config.key
17+
accessKey: this.config.key,
18+
isApp : false
1819
};
1920

21+
if (this.config.product === 'appAutomation') lambdaCredentials.isApp =true
22+
2023
if (this.config.logFile) {
2124
lambdaCredentials.logFile = this.config.logFile;
2225
}
@@ -30,6 +33,12 @@ export default class LambdaRestService {
3033
}
3134
}
3235

36+
beforeScenario(world) {
37+
if (!!!this.suiteTitle){
38+
this.suiteTitle = world.pickle.name || 'unknown scenario'
39+
}
40+
}
41+
3342
beforeSuite(suite) {
3443
this.suiteTitle = suite.title;
3544
}
@@ -38,12 +47,12 @@ export default class LambdaRestService {
3847
if (!this.isServiceEnabled) {
3948
return;
4049
}
41-
if (test.title){
50+
if (test.title && !!!this.testTitle){
4251
this.testTitle = test.title
4352
}
4453

4554
if (this.suiteTitle === 'Jasmine__TopLevel__Suite') {
46-
this.suiteTitle = test.fullName.slice(0, test.fullName.indexOf(test.title) - 1);
55+
this.suiteTitle = test.fullName;
4756
}
4857
}
4958

@@ -146,8 +155,11 @@ export default class LambdaRestService {
146155
getBody(failures, calledOnReload = false, browserName) {
147156
let body = {};
148157
if (!(!global.browser.isMultiremote && this.capabilities.name || global.browser.isMultiremote && this.capabilities[browserName].capabilities.name)) {
149-
150-
body.name = this.suiteTitle + ' - ' + this.testTitle
158+
let testName = this.suiteTitle
159+
if (this.testTitle){
160+
testName = testName + ' - ' + this.testTitle;
161+
}
162+
body.name = testName
151163

152164
if (this.capabilities['LT:Options'] && this.capabilities['LT:Options'].name){
153165
body.name = this.capabilities['LT:Options'].name

0 commit comments

Comments
 (0)