froth-webdriverio-framework 7.0.78 → 7.0.80
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.
|
@@ -404,64 +404,6 @@ async function normalizeWdioError(error) {
|
|
|
404
404
|
return `Automation framework error: ${msg}`;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
async function getBrowserStackCapabilities(baseCaps) {
|
|
408
|
-
if (
|
|
409
|
-
process.env.PLATFORM !== 'browserstack' &&
|
|
410
|
-
process.env.PLATFORM !== 'browserstacklocal'
|
|
411
|
-
) {
|
|
412
|
-
return baseCaps;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
console.log('🟡 Raw Capabilities (Before):');
|
|
416
|
-
console.log(JSON.stringify(baseCaps, null, 2));
|
|
417
|
-
|
|
418
|
-
// ✅ Normalize to array
|
|
419
|
-
const isArray = Array.isArray(baseCaps);
|
|
420
|
-
const capsArray = isArray ? baseCaps : [baseCaps];
|
|
421
|
-
|
|
422
|
-
const updatedCaps = await Promise.all(
|
|
423
|
-
capsArray.map(async (capabilities) => {
|
|
424
|
-
const bsOpts = capabilities['bstack:options'] || {};
|
|
425
|
-
|
|
426
|
-
console.log('🟢 Existing bstack:options (Before Modification):');
|
|
427
|
-
console.log(JSON.stringify(bsOpts, null, 2));
|
|
428
|
-
|
|
429
|
-
if (process.env.BS_SESSION_TYPE === 'app-automate') {
|
|
430
|
-
const appPath = process.env.BROWSERSTACK_APP_PATH;
|
|
431
|
-
if (!appPath) {
|
|
432
|
-
await failExecution('BROWSERSTACK_APP_PATH is missing');
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
bsOpts.app = appPath;
|
|
436
|
-
capabilities['appium:app'] = appPath;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
bsOpts.deviceName = 'Samsung Galaxy S22 Ultra';
|
|
440
|
-
bsOpts.osVersion = '12.0';
|
|
441
|
-
bsOpts.networkLogs = false;
|
|
442
|
-
bsOpts.debug = false;
|
|
443
|
-
|
|
444
|
-
// ⚠️ NEVER assign env vars like this inside code
|
|
445
|
-
// process.env.BS_UPLOAD_MEDIA = "..."
|
|
446
|
-
process.env.BS_UPLOAD_MEDIA = "media://8440f686585de9b46e1c966ce764703836f918bc,media://2952ee7b9b7f0751624b0d4208d7c00b56d4e49b"
|
|
447
|
-
if (process.env.BS_UPLOAD_MEDIA) {
|
|
448
|
-
bsOpts.uploadMedia = process.env.BS_UPLOAD_MEDIA
|
|
449
|
-
.split(',')
|
|
450
|
-
.map(x => x.trim());
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
capabilities['bstack:options'] = bsOpts;
|
|
454
|
-
|
|
455
|
-
console.log('🟢 Existing bstack:options (After Modification):');
|
|
456
|
-
console.log(JSON.stringify(bsOpts, null, 2));
|
|
457
|
-
|
|
458
|
-
return capabilities;
|
|
459
|
-
})
|
|
460
|
-
);
|
|
461
|
-
|
|
462
|
-
// ✅ Return in original shape
|
|
463
|
-
return isArray ? updatedCaps : updatedCaps[0];
|
|
464
|
-
}
|
|
465
407
|
|
|
466
408
|
|
|
467
409
|
module.exports = commonHooks;
|
|
@@ -64,7 +64,9 @@ async function setLoginToken() {
|
|
|
64
64
|
async function setExecutionDetails() {
|
|
65
65
|
let getExeDetails;
|
|
66
66
|
try {
|
|
67
|
-
|
|
67
|
+
// getExeDetails = await exeDetails.getExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"));
|
|
68
|
+
getExeDetails = await exeDetails.getExecuitonDetails(process.env.ORGANISATION_DOMAIN_URL, process.env.API_TOKEN, process.env.EXECUTION_ID);
|
|
69
|
+
|
|
68
70
|
process.env.AUTOMATION_SUITE_ID = getExeDetails.automation_suite_id;
|
|
69
71
|
// process.env.EXEC_BROWSERSTACK_LOCAL =
|
|
70
72
|
// String(getExeDetails.browser_stack_local);
|
|
@@ -21,7 +21,8 @@ try {
|
|
|
21
21
|
process.env.BROWSERSTACK_USERNAME = bsCaps.userName
|
|
22
22
|
process.env.BROWSERSTACK_ACCESS_KEY = Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8')
|
|
23
23
|
// Merge chrome-specific options if applicable
|
|
24
|
-
|
|
24
|
+
await setAllDetails.setExecutionDetails()
|
|
25
|
+
|
|
25
26
|
} catch (e) {
|
|
26
27
|
console.error('❌ Failed to load capability YAML:', err.message);
|
|
27
28
|
process.exit(1);
|
|
@@ -62,6 +63,52 @@ if (PLATFORM === 'browserstack' || PLATFORM === 'browserstacklocal') {
|
|
|
62
63
|
: require('./local/mobile.config');
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
console.log('====> envConfig :', envConfig);
|
|
67
|
+
envConfig = await getBrowserStackCapabilities(envConfig)
|
|
68
|
+
async function getBrowserStackCapabilities(baseCaps) {
|
|
69
|
+
if (
|
|
70
|
+
process.env.PLATFORM !== 'browserstack' &&
|
|
71
|
+
process.env.PLATFORM !== 'browserstacklocal'
|
|
72
|
+
) {
|
|
73
|
+
return baseCaps;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
console.log('🟡 Raw Capabilities (Before):');
|
|
77
|
+
console.log(JSON.stringify(baseCaps, null, 2));
|
|
78
|
+
|
|
79
|
+
// ✅ Normalize to array
|
|
80
|
+
const isArray = Array.isArray(baseCaps);
|
|
81
|
+
const capsArray = isArray ? baseCaps : [baseCaps];
|
|
82
|
+
|
|
83
|
+
const updatedCaps = await Promise.all(
|
|
84
|
+
capsArray.map(async (capabilities) => {
|
|
85
|
+
const bsOpts = capabilities['bstack:options'] || {};
|
|
86
|
+
|
|
87
|
+
console.log('🟢 Existing bstack:options (Before Modification):');
|
|
88
|
+
console.log(JSON.stringify(bsOpts, null, 2));
|
|
89
|
+
|
|
90
|
+
// ⚠️ NEVER assign env vars like this inside code
|
|
91
|
+
// process.env.BS_UPLOAD_MEDIA = "..."
|
|
92
|
+
process.env.BS_UPLOAD_MEDIA = "media://8440f686585de9b46e1c966ce764703836f918bc,media://2952ee7b9b7f0751624b0d4208d7c00b56d4e49b"
|
|
93
|
+
if (process.env.BS_UPLOAD_MEDIA) {
|
|
94
|
+
bsOpts.uploadMedia = process.env.BS_UPLOAD_MEDIA
|
|
95
|
+
.split(',')
|
|
96
|
+
.map(x => x.trim());
|
|
97
|
+
}
|
|
98
|
+
// capabilities['browserstack.uploadMedia'] = '{"media://8440f686585de9b46e1c966ce764703836f918bc","media://2952ee7b9b7f0751624b0d4208d7c00b56d4e49b"}'
|
|
99
|
+
|
|
100
|
+
capabilities['bstack:options'] = bsOpts;
|
|
101
|
+
|
|
102
|
+
console.log('🟢 Existing bstack:options (After Modification):');
|
|
103
|
+
console.log(JSON.stringify(bsOpts, null, 2));
|
|
104
|
+
|
|
105
|
+
return capabilities;
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// ✅ Return in original shape
|
|
110
|
+
return isArray ? updatedCaps : updatedCaps[0];
|
|
111
|
+
}
|
|
65
112
|
|
|
66
113
|
exports.config = deepmerge(baseConfig, envConfig(bsCaps));
|
|
67
114
|
|