froth-webdriverio-framework 6.0.2 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,9 +80,10 @@ const commonconfig = {
80
80
  // set the capability like media and app and bs local
81
81
  if (process.env.PLATFORM === 'browserstack') {
82
82
  /// console.log("capabilities:", capabilities);
83
- console.log("====> BROWSERSTACK_LOCAL : "+process.env.BROWSERSTACK_LOCAL);
83
+ console.log("====> BROWSERSTACK_LOCAL : " + process.env.BROWSERSTACK_LOCAL);
84
+ const isLocalEnabled = process.env.BROWSERSTACK_LOCAL === "true";
84
85
 
85
- if (process.env.BROWSERSTACK_LOCAL) {
86
+ if (isLocalEnabled) {
86
87
  bsLocal = new browserstack.Local();
87
88
  const localArgs = {
88
89
  key: process.env.BROWSERSTACK_ACCESS_KEY,
@@ -102,22 +103,28 @@ const commonconfig = {
102
103
  capabilities['browserstack.local'] = true;
103
104
  capabilities['browserstack.localIdentifier'] = localArgs.localIdentifier || 'ExecuteLocal';
104
105
  }
105
- else
106
- console.log("====> BROWSERSTACK_LOCAL not set. Skipping BrowserStack Local startup."+process.env.BROWSERSTACK_LOCAL);
106
+ else {
107
+ console.log("====> BROWSERSTACK_LOCAL not set. Skipping BrowserStack Local startup." + process.env.BROWSERSTACK_LOCAL);
108
+ // Make sure no stale values from config remain
109
+ delete capabilities['browserstack.local'];
110
+ delete capabilities['browserstack.localIdentifier'];
111
+ }
107
112
 
108
113
  // capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
109
114
  if (capabilities.platformName === 'android' || capabilities.platformName === 'ios') {
110
115
  capabilities['appium:app'] = process.env.BROWSERSTACK_APP_PATH;
111
-
112
- // capabilities.app = process.env.BROWSERSTACK_APP_PATH;
113
- if (capabilities.app === undefined || capabilities.app === null || capabilities.app === '') {
116
+
117
+ // capabilities.app = process.env.BROWSERSTACK_APP_PATH;
118
+ const appValue = capabilities['appium:app'];
119
+ console.log("App Value:", appValue);
120
+ if (appValue === undefined || appValue === null || appValue === '') {
114
121
  console.error("🚨 Error: BROWSERSTACK_APP_PATH is not defined or empty.");
115
122
  resultdetails.excution_status = 'FAILED';
116
123
  resultdetails.comments.push("BROWSERSTACK_APP_PATH is not defined or empty.");
117
124
  await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails);
118
125
  process.exit(1); // Stop execution if app path is not set
119
126
  } else {
120
- console.log("App Path:", capabilities.app);
127
+ console.log("App Path:", capabilities['appium:app']);
121
128
  console.log("Browserstack Local:", capabilities.browserstackLocal);
122
129
  }
123
130
  }
@@ -134,6 +141,10 @@ const commonconfig = {
134
141
  console.error("Error parsing MEDIA_FILES:", error);
135
142
  }
136
143
 
144
+ // Normalized structure to support future SauceLabs
145
+ // if (!capabilities['bstack:options']) {
146
+ // capabilities['bstack:options'] = {};
147
+ // }
137
148
  console.log(`Running tests on after app,bslocal,mediafiles: ${JSON.stringify(capabilities)}`);
138
149
  }
139
150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",