froth-webdriverio-framework 6.0.76 → 6.0.77

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.
@@ -149,10 +149,29 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
149
149
  headers: { 'Authorization': `Bearer ${token}` },
150
150
  body: formData
151
151
  });
152
+ // Log raw response info
153
+ console.log('📤 API Response Status:', response.status);
154
+ console.log('📤 API Response Headers:', JSON.stringify([...response.headers]));
155
+ let responseText;
156
+ try {
157
+ responseText = await response.text();
158
+ console.log('📤 API Response Body (text):', responseText);
159
+ } catch (err) {
160
+ console.error('❌ Error reading response body:', err.message);
161
+ }
162
+
163
+ // Then handle response as JSON if needed
164
+ let data;
165
+ try {
166
+ data = JSON.parse(responseText);
167
+ } catch {
168
+ data = null;
169
+ }
152
170
 
171
+ console.log('📤 Parsed Response:', data);
153
172
 
154
- const data = await handleResponse(response, 'updateExecuitonDetails');
155
- if (!data) return;
173
+ const result = await handleResponse(response, 'updateExecuitonDetails');
174
+ if (!result) return;
156
175
 
157
176
  BUFFER.setItem('FROTH_UPDATE_EXECUTION', 'TRUE');
158
177
  console.log('✅ Execution details updated');
@@ -86,7 +86,8 @@ async function failExecution(reason) {
86
86
  const commonHooks = {
87
87
 
88
88
  /* ========== ON PREPARE ========== */
89
- onPrepare: async () => {
89
+ onPrepare: async (config) => {
90
+
90
91
  suiteStartTime = Date.now();
91
92
  registerGlobalErrorHandlers();
92
93
 
@@ -127,6 +128,10 @@ const commonHooks = {
127
128
 
128
129
  if (process.env.PLATFORM === 'browserstack' || process.env.PLATFORM === 'browserstacklocal') {
129
130
  const bsOpts = capabilities['bstack:options'] || {};
131
+ process.env.BROWSERSTACK_USERNAME = bsOpts.userName
132
+ process.env.BROWSERSTACK_ACCESS_KEY = bsOpts.accessKey
133
+ console.log('✅ BS_USERNAME set from capabilities:', process.env.BROWSERSTACK_USERNAME);
134
+
130
135
  if (process.env.BS_SESSION_TYPE === 'app-automate') {
131
136
  const appPath = process.env.BROWSERSTACK_APP_PATH;
132
137
  if (!appPath) {
@@ -152,8 +157,6 @@ const commonHooks = {
152
157
  console.log('final cinfig dteials :' + JSON.stringify(capabilities))
153
158
 
154
159
  console.log("config details " + JSON.stringify(config))
155
- process.env.BROWSERSTACK_USERNAME = config.userName
156
- process.env.BROWSERSTACK_ACCESS_KEY = config.accessKey
157
160
 
158
161
 
159
162
  } catch (error) {
@@ -196,7 +199,7 @@ const commonHooks = {
196
199
 
197
200
  if (!passed) {
198
201
  resultdetails.comments.push(`${test.title} - ${error?.message || 'Failed'}`);
199
- }else
202
+ } else
200
203
  resultdetails.comments.push(`${test.title} - 'Passed'}`);
201
204
 
202
205
  const suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
@@ -226,7 +229,7 @@ const commonHooks = {
226
229
  console.log('==== AFTER SESSION ====');
227
230
  // Do not calculate time here; we will use WDIO's total duration in onComplete
228
231
  console.log('⏱ Leaving execution time calculation for onComplete hook');
229
-
232
+
230
233
  },
231
234
 
232
235
  /* ========== ON ERROR ========== */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "6.0.76",
3
+ "version": "6.0.77",
4
4
  "readme": "WendriverIO Integration with [BrowserStack](https://www.browserstack.com)",
5
5
  "description": "Selenium examples for WebdriverIO and BrowserStack App Automate",
6
6
  "scripts": {