froth-webdriverio-framework 7.0.60 → 7.0.61
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.
- package/froth_configs/commonhook.js +22 -18
- package/package.json +1 -1
|
@@ -335,7 +335,6 @@ async function normalizeWdioError(error) {
|
|
|
335
335
|
return `Automation framework error: ${msg}`;
|
|
336
336
|
}
|
|
337
337
|
async function getBrowserStackCapabilities(baseCaps) {
|
|
338
|
-
|
|
339
338
|
if (
|
|
340
339
|
process.env.PLATFORM !== 'browserstack' &&
|
|
341
340
|
process.env.PLATFORM !== 'browserstacklocal'
|
|
@@ -343,28 +342,33 @@ async function getBrowserStackCapabilities(baseCaps) {
|
|
|
343
342
|
return baseCaps;
|
|
344
343
|
}
|
|
345
344
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
console.log("after comma separted " + process.env.BS_UPLOAD_MEDIA)
|
|
345
|
+
// Ensure we work with array
|
|
346
|
+
const capsArray = Array.isArray(baseCaps) ? baseCaps : [baseCaps];
|
|
347
|
+
|
|
348
|
+
const updatedCaps = capsArray.map((capabilities) => {
|
|
351
349
|
const bsOpts = capabilities['bstack:options'] || {};
|
|
352
|
-
|
|
353
|
-
//
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
//
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
350
|
+
|
|
351
|
+
// Optional: debug
|
|
352
|
+
bsOpts.debug = process.env.BS_DEBUG === 'true';
|
|
353
|
+
|
|
354
|
+
// Handle uploadMedia
|
|
355
|
+
if (process.env.MEDIA_FILES) {
|
|
356
|
+
try {
|
|
357
|
+
const media = JSON.parse(process.env.MEDIA_FILES).map(x => x.trim());
|
|
358
|
+
if (media.length) {
|
|
359
|
+
bsOpts.uploadMedia = media;
|
|
360
|
+
}
|
|
361
|
+
} catch (e) {
|
|
362
|
+
console.warn('Invalid MEDIA_FILES JSON:', process.env.MEDIA_FILES);
|
|
363
|
+
}
|
|
364
364
|
}
|
|
365
|
+
|
|
365
366
|
capabilities['bstack:options'] = bsOpts;
|
|
366
367
|
return capabilities;
|
|
367
368
|
});
|
|
369
|
+
|
|
370
|
+
// Return same type as input: array or single object
|
|
371
|
+
return Array.isArray(baseCaps) ? updatedCaps : updatedCaps[0];
|
|
368
372
|
}
|
|
369
373
|
|
|
370
374
|
module.exports = commonHooks;
|