froth-webdriverio-framework 6.0.44 → 6.0.46

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.
@@ -1,26 +1,22 @@
1
1
 
2
2
  const commonHooks = require('../commonhook');
3
- const isLocal = process.env.LOCAL === 'true';
4
- console.log('====> BrowserStack Local enabled:', isLocal);
5
-
6
-
7
- module.exports = (bsCaps, isLocal = false, appPath) => ({
3
+ module.exports = (bsCaps) => ({
8
4
 
9
5
  ...commonHooks,
10
6
  user: bsCaps.userName,
11
- key: bsCaps.accessKey,
7
+ key: Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8'),
12
8
 
13
9
  services: [
14
10
  [
15
11
  'browserstack',
16
12
  {
17
13
  buildIdentifier: process.env.BUILD_NUMBER || 'local-build',
18
- browserstackLocal: isLocal,
14
+ browserstackLocal: false,
19
15
  opts: {
20
- forcelocal: isLocal,
16
+ forcelocal: false,
21
17
  localIdentifier: `wdio-${process.pid}`,
22
18
  },
23
- app: appPath,
19
+ app: process.env.BROWSERSTACK_APP_PATH,
24
20
  },
25
21
  ],
26
22
  ],
@@ -0,0 +1,39 @@
1
+
2
+ const commonHooks = require('../commonhook');
3
+ module.exports = (bsCaps) => ({
4
+
5
+ ...commonHooks,
6
+ user: bsCaps.userName,
7
+ key: Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8'),
8
+
9
+ services: [
10
+ [
11
+ 'browserstack',
12
+ {
13
+ buildIdentifier: process.env.BUILD_NUMBER || 'local-build',
14
+ browserstackLocal: true,
15
+ opts: {
16
+ forcelocal: true,
17
+ localIdentifier: `wdio-${process.pid}`,
18
+ },
19
+ app: process.env.BROWSERSTACK_APP_PATH,
20
+ },
21
+ ],
22
+ ],
23
+
24
+
25
+ capabilities: [{
26
+ 'bstack:options': {
27
+ projectName: 'BrowserStack Samples',
28
+ buildName: 'browserstack build',
29
+ sessionName: 'Mobile Test',
30
+ deviceName: bsCaps.deviceName || 'Samsung Galaxy S22 Ultra',
31
+ osVersion: bsCaps.platformVersion || '12.0',
32
+ debug: bsCaps.debug,
33
+ networkLogs: bsCaps.networkLogs,
34
+ interactiveDebugging: bsCaps.interactiveDebugging
35
+ }
36
+ }],
37
+
38
+ updateJob: false
39
+ });
@@ -1,14 +1,14 @@
1
1
  module.exports = (bsCaps) => ({
2
2
  user: bsCaps.userName,
3
- key: bsCaps.accessKey,
3
+ key: Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8'),
4
4
 
5
5
 
6
6
  services: [
7
7
  [
8
8
  'browserstack',
9
9
  {
10
- browserstackLocal: isLocal,
11
- opts: { forcelocal: isLocal }
10
+ browserstackLocal: false,
11
+ opts: { forcelocal: false }
12
12
  }
13
13
  ]
14
14
  ],
@@ -0,0 +1,25 @@
1
+ module.exports = (bsCaps) => ({
2
+ user: bsCaps.userName,
3
+ key: Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8'),
4
+
5
+
6
+ services: [
7
+ [
8
+ 'browserstack',
9
+ {
10
+ browserstackLocal: true,
11
+ opts: { forcelocal: true }
12
+ }
13
+ ]
14
+ ],
15
+
16
+
17
+ capabilities: [{
18
+ browserName: process.env.BROWSER || 'chrome',
19
+ 'bstack:options': {
20
+ os: 'Windows',
21
+ osVersion: '11',
22
+ buildName: 'BS Web Build'
23
+ }
24
+ }]
25
+ });
@@ -1,12 +1,43 @@
1
1
 
2
2
  const setAllDetails = require('./setallDatailinBuffer');
3
-
3
+ let getExeDetails;
4
4
  module.exports = {
5
5
  onPrepare: async () => {
6
6
  console.log('==== ON PREPARE HOOK ====');
7
+ await setAllDetails.setEnvVariables();
8
+ getExeDetails=await setAllDetails.setExecutionDetails();
9
+
7
10
  await setAllDetails.setSuiteDetails();
8
11
  await setAllDetails.setTestDataDetails();
9
12
 
10
13
  console.log('✅ App & media updated before execution');
14
+ },
15
+
16
+ beforeSession: async function (config, capabilities, specs) {
17
+ try {
18
+ if (config.services) {
19
+ const bsService = config.services.find(
20
+ s => Array.isArray(s) && s[0] === 'browserstack'
21
+ );
22
+
23
+ if (bsService) {
24
+ bsService[1].app = process.env.BROWSERSTACK_APP_PATH
25
+ // bsService[1].browserstackLocal = isLocal;
26
+
27
+ // if (isLocal) {
28
+ // bsService[1].opts = bsService[1].opts || {};
29
+ // bsService[1].opts.forcelocal = true;
30
+ // bsService[1].opts.localIdentifier = `wdio-${process.pid}`;
31
+ // }
32
+
33
+ // console.log(`✅ BrowserStack Local: ${bsService[1].browserstackLocal}`);
34
+ console.log(`✅ App Path: ${bsService[1].app}`);
35
+ }
36
+ }
37
+
38
+ } catch (error) {
39
+ console.error('🚨 Error in beforeSession:', error);
40
+ console.error('🚨 Error in beforeSession:', error.message);
41
+ }
11
42
  }
12
43
  };
@@ -63,7 +63,7 @@ async function setExecutionDetails() {
63
63
  process.env.AUTOMATION_SUITE_ID = getExeDetails.automation_suite_id;
64
64
  // process.env.EXEC_BROWSERSTACK_LOCAL =
65
65
  // String(getExeDetails.browser_stack_local);
66
- // process.env.BROWSERSTACK_APP_PATH = getExeDetails.app_url;
66
+ process.env.BROWSERSTACK_APP_PATH = getExeDetails.app_url;
67
67
  process.env.MEDIA_FILES = JSON.stringify(getExeDetails.mediaurls);
68
68
  console.log("Execution Details:", JSON.stringify(getExeDetails));
69
69
 
@@ -9,33 +9,7 @@ const { LocalStorage } = require('node-localstorage');
9
9
  global.BUFFER = new LocalStorage('./buffer_storage');
10
10
  let envConfig;
11
11
  let bsCaps;
12
- let local = false;
13
- let appPath = '';
14
- // --------------------
15
- // Step 1: Fetch execution details BEFORE config loads
16
- // --------------------
17
- function loadExecutionDetails() {
18
- try {
19
- console.log("Inside the lcoal execution deatils")
20
- setAllDetails.setEnvVariables();
21
- const getExeDetails = setAllDetails.setExecutionDetails();
22
- // ✅ SAFE: App assignment only
23
- appPath=getExeDetails.app_url;
24
- // appPath = 'bs://30fdf3a163d0bad126f64a3d5713e9ab0086a41e';
25
12
 
26
- // Map API flag → LOCAL
27
- local =
28
- String(getExeDetails.browser_stack_local) === 'true' ? 'true' : 'false';
29
- // local=false;
30
- console.log('✅ Execution details loaded, LOCAL:', local);
31
- console.log('✅ App URL:', process.env.BROWSERSTACK_APP_PATH);
32
- } catch (error) {
33
- console.error('❌ Failed to load execution details:', error.message);
34
- process.exit(1);
35
- }
36
- }
37
-
38
- loadExecutionDetails();
39
13
 
40
14
  try {
41
15
  const configFile = process.env.YML_NAME;
@@ -79,6 +53,11 @@ if (PLATFORM === 'browserstack') {
79
53
  OS === 'web'
80
54
  ? require('./browserstack/web.config')
81
55
  : require('./browserstack/mobile.config');
56
+ } else if (PLATFORM === 'browserstacklocal') {
57
+ envConfig =
58
+ OS === 'web'
59
+ ? require('./browserstack/weblocal.config')
60
+ : require('./browserstack/mobilelocal.config');
82
61
  } else {
83
62
  envConfig =
84
63
  OS === 'web'
@@ -87,5 +66,5 @@ if (PLATFORM === 'browserstack') {
87
66
  }
88
67
 
89
68
 
90
- exports.config = deepmerge(baseConfig, envConfig(bsCaps, local, appPath));
69
+ exports.config = deepmerge(baseConfig, envConfig(bsCaps));
91
70
 
package/local.log CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
 
3
- Sat Dec 13 2025 17:21:35:889 GMT+0800 (+08) -- [WARNING] Skipping initialisation of configuration console because: port already in use by another Binary
4
- Sat Dec 13 2025 17:21:38:172 GMT+0800 (+08) -- [SUCCESS] You can now access your local server(s) in our remote browser
3
+ Sat Dec 13 2025 18:08:44:22 GMT+0800 (+08) -- [WARNING] Skipping initialisation of configuration console because: port already in use by another Binary
4
+ Sat Dec 13 2025 18:08:45:882 GMT+0800 (+08) -- [SUCCESS] You can now access your local server(s) in our remote browser
5
5
 
6
- Sat Dec 13 2025 17:21:38:646 GMT+0800 (+08) -- Press Ctrl-C to exit
6
+ Sat Dec 13 2025 18:08:46:471 GMT+0800 (+08) -- Press Ctrl-C to exit
7
7
 
8
8
 
@@ -3089,5 +3089,165 @@
3089
3089
  "success": true,
3090
3090
  "failure": null,
3091
3091
  "worker": 54873
3092
+ },
3093
+ {
3094
+ "name": "sdk:testhub",
3095
+ "entryType": "measure",
3096
+ "startTime": 584.3517920002341,
3097
+ "duration": 1029.3765049995854,
3098
+ "detail": null,
3099
+ "success": true,
3100
+ "failure": null,
3101
+ "worker": 64977
3102
+ },
3103
+ {
3104
+ "name": "sdk:percy",
3105
+ "entryType": "measure",
3106
+ "startTime": 1618.8329159999266,
3107
+ "duration": 1557.383558000438,
3108
+ "detail": null,
3109
+ "success": false,
3110
+ "failure": {},
3111
+ "worker": 64977
3112
+ },
3113
+ {
3114
+ "name": "sdk:automate:local",
3115
+ "entryType": "measure",
3116
+ "startTime": 3177.0904930001125,
3117
+ "duration": 0.5492289997637272,
3118
+ "detail": null,
3119
+ "success": true,
3120
+ "failure": null,
3121
+ "worker": 64977
3122
+ },
3123
+ {
3124
+ "name": "sdk:automate:hub-management",
3125
+ "entryType": "measure",
3126
+ "startTime": 6245.940608999692,
3127
+ "duration": 2091.7997440006584,
3128
+ "detail": null,
3129
+ "success": true,
3130
+ "failure": null,
3131
+ "worker": 64977
3132
+ },
3133
+ {
3134
+ "name": "sdk:testhub",
3135
+ "entryType": "measure",
3136
+ "startTime": 658.3024300001562,
3137
+ "duration": 772.3301300005987,
3138
+ "detail": null,
3139
+ "success": true,
3140
+ "failure": null,
3141
+ "worker": 66103
3142
+ },
3143
+ {
3144
+ "name": "sdk:percy",
3145
+ "entryType": "measure",
3146
+ "startTime": 1435.2463230006397,
3147
+ "duration": 621.0194339994341,
3148
+ "detail": null,
3149
+ "success": false,
3150
+ "failure": {},
3151
+ "worker": 66103
3152
+ },
3153
+ {
3154
+ "name": "sdk:proxy-setup",
3155
+ "entryType": "measure",
3156
+ "startTime": 2058.1032360000536,
3157
+ "duration": 0.06273800041526556,
3158
+ "detail": null,
3159
+ "success": true,
3160
+ "failure": null,
3161
+ "worker": 66103
3162
+ },
3163
+ {
3164
+ "name": "sdk:automate:local",
3165
+ "entryType": "measure",
3166
+ "startTime": 2057.09384100046,
3167
+ "duration": 5257.794490000233,
3168
+ "detail": null,
3169
+ "success": true,
3170
+ "failure": null,
3171
+ "worker": 66103
3172
+ },
3173
+ {
3174
+ "name": "sdk:automate:hub-management",
3175
+ "entryType": "measure",
3176
+ "startTime": 10421.891823000275,
3177
+ "duration": 2024.4507929999381,
3178
+ "detail": null,
3179
+ "success": true,
3180
+ "failure": null,
3181
+ "worker": 66103
3182
+ },
3183
+ {
3184
+ "name": "sdk:testhub",
3185
+ "entryType": "measure",
3186
+ "startTime": 609.2429510001093,
3187
+ "duration": 719.5072510000318,
3188
+ "detail": null,
3189
+ "success": true,
3190
+ "failure": null,
3191
+ "worker": 67386
3192
+ },
3193
+ {
3194
+ "name": "sdk:percy",
3195
+ "entryType": "measure",
3196
+ "startTime": 1334.0576780010015,
3197
+ "duration": 1346.1903069987893,
3198
+ "detail": null,
3199
+ "success": false,
3200
+ "failure": {},
3201
+ "worker": 67386
3202
+ },
3203
+ {
3204
+ "name": "sdk:automate:local",
3205
+ "entryType": "measure",
3206
+ "startTime": 2681.1390269994736,
3207
+ "duration": 0.4086330011487007,
3208
+ "detail": null,
3209
+ "success": true,
3210
+ "failure": null,
3211
+ "worker": 67386
3212
+ },
3213
+ {
3214
+ "name": "sdk:automate:hub-management",
3215
+ "entryType": "measure",
3216
+ "startTime": 6115.410945000127,
3217
+ "duration": 2060.080311000347,
3218
+ "detail": null,
3219
+ "success": true,
3220
+ "failure": null,
3221
+ "worker": 67386
3222
+ },
3223
+ {
3224
+ "name": "sdk:testhub",
3225
+ "entryType": "measure",
3226
+ "startTime": 669.5280009992421,
3227
+ "duration": 876.9355170000345,
3228
+ "detail": null,
3229
+ "success": true,
3230
+ "failure": null,
3231
+ "worker": 72622
3232
+ },
3233
+ {
3234
+ "name": "sdk:percy",
3235
+ "entryType": "measure",
3236
+ "startTime": 1555.7868489995599,
3237
+ "duration": 782.0750929992646,
3238
+ "detail": null,
3239
+ "success": false,
3240
+ "failure": {},
3241
+ "worker": 72622
3242
+ },
3243
+ {
3244
+ "name": "sdk:automate:local",
3245
+ "entryType": "measure",
3246
+ "startTime": 2338.536307999864,
3247
+ "duration": 0.5059179998934269,
3248
+ "detail": null,
3249
+ "success": true,
3250
+ "failure": null,
3251
+ "worker": 72622
3092
3252
  }
3093
3253
  ]