Skip to content

Commit 3edaede

Browse files
author
Zdravko
authored
fix: how we set app caps for sauce labs (#147)
1 parent 8faeec1 commit 3edaede

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/ns-capabilities.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,18 @@ export class NsCapabilities implements INsCapabilities {
192192

193193
private resolveApplication() {
194194
if (this.isSauceLab) {
195-
this._appiumCaps.app = `sauce-storage:${this.appPath}`
195+
if (this.appPath){
196+
if (this.appPath.startsWith("http")){
197+
this._appiumCaps.app = this.appPath;
198+
} else {
199+
this._appiumCaps.app = `sauce-storage:${this.appPath}`;
200+
}
201+
} else if (!this._appiumCaps.app){
202+
throw new Error("Neither appPath option nor capabilities.app provided!!!");
203+
}
204+
196205
this._ignoreDeviceController = true;
197-
console.log("Using Sauce Labs. The application path is changed to: " + this.appPath);
206+
console.log("Using Sauce Labs. The application path is changed to: " + this._appiumCaps.app);
198207
} else {
199208
this.appiumCaps.app = getAppPath(this);
200209
this._appPath = this._appiumCaps.app;

0 commit comments

Comments
 (0)