froth-webdriverio-framework 7.0.89 → 7.0.91

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.
@@ -2,15 +2,22 @@ const commonHooks = require('../commonhook');
2
2
 
3
3
  // 🔹 parse comma-separated BS_UPLOAD_MEDIA
4
4
  let uploadMediaList;
5
- if (process.env.BS_UPLOAD_MEDIA!=null||process.env.BS_UPLOAD_MEDIA!='null'||process.env.BS_UPLOAD_MEDIA!='') {
6
- uploadMediaList = process.env.BS_UPLOAD_MEDIA
5
+ const rawMedia = process.env.BS_UPLOAD_MEDIA;
6
+ const DISABLED_VALUES = ['NONE', 'null', 'undefined', ''];
7
+ console.log('BS_UPLOAD_MEDIA raw =', rawMedia);
8
+
9
+ // Only proceed if value is valid
10
+ if (
11
+ rawMedia &&
12
+ !DISABLED_VALUES.includes(rawMedia)
13
+ ) {
14
+
15
+ uploadMediaList = rawMedia
7
16
  .split(',')
8
17
  .map(v => v.trim())
9
18
  .filter(Boolean);
10
19
 
11
- if (uploadMediaList.length === 0) {
12
- uploadMediaList = 'undefined';
13
- }
20
+ console.log('Parsed uploadMedia =', uploadMediaList);
14
21
  }
15
22
 
16
23
  module.exports = (bsCaps) => {
@@ -28,7 +35,8 @@ module.exports = (bsCaps) => {
28
35
  };
29
36
 
30
37
  // 🔹 conditionally add uploadMedia
31
- if (uploadMediaList) {
38
+ // Conditionally add uploadMedia
39
+ if (uploadMediaList?.length) {
32
40
  bstackOptions.uploadMedia = uploadMediaList;
33
41
  }
34
42
 
@@ -1,41 +1,63 @@
1
1
  const commonHooks = require('../commonhook');
2
+ // 🔹 Parse comma-separated BS_UPLOAD_MEDIA for web
3
+ let uploadMediaList;
4
+ const rawMedia = process.env.BS_UPLOAD_MEDIA;
5
+ const DISABLED_VALUES = ['NONE', 'null', 'undefined', ''];
6
+
7
+ if (rawMedia && !DISABLED_VALUES.includes(rawMedia)) {
8
+ uploadMediaList = rawMedia
9
+ .split(',')
10
+ .map(v => v.trim())
11
+ .filter(Boolean);
12
+ }
13
+
2
14
  module.exports = (bsCaps) => {
3
15
  const PLATFORM = process.env.PLATFORM || 'browserstack';
4
-
5
16
  const isBSLocal = PLATFORM === 'browserstacklocal';
6
17
 
18
+
19
+ // 🔹 Build bstack options
20
+ const bstackOptions = {
21
+ os: bsCaps.os,
22
+ osVersion: bsCaps.osVersion,
23
+ buildName: 'Web_Build-',
24
+ debug: bsCaps.debug,
25
+ networkLogs: bsCaps.networkLogs,
26
+ interactiveDebugging: bsCaps.interactiveDebugging,
27
+ };
28
+
29
+ // 🔹 Conditionally add uploadMedia
30
+ if (uploadMediaList?.length) {
31
+ bstackOptions.uploadMedia = uploadMediaList;
32
+ }
33
+
7
34
  return {
8
35
  ...commonHooks,
36
+
9
37
  user: bsCaps.userName,
10
38
  key: Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8'),
11
39
 
12
-
13
40
  services: [
14
41
  [
15
42
  'browserstack',
16
43
  {
17
- buildIdentifier: process.env.BROWSERSTACK_BUILD_NAME || 'local-build',
44
+ buildIdentifier:
45
+ process.env.BROWSERSTACK_BUILD_NAME || 'local-build',
18
46
  browserstackLocal: isBSLocal,
19
47
  opts: {
20
48
  forcelocal: isBSLocal,
21
49
  localIdentifier: `wdio-${process.pid}`,
22
- }
23
- }
24
- ]
50
+ },
51
+ },
52
+ ],
25
53
  ],
26
54
 
27
-
28
- capabilities: [{
29
- browserName: bsCaps.browserName || 'chrome',
30
- browserVersion: bsCaps.browserVersion,
31
- 'bstack:options': {
32
- os: bsCaps.os,
33
- osVersion: bsCaps.osVersion,
34
- buildName: 'Web_Build-',
35
- debug: bsCaps.debug,
36
- networkLogs: bsCaps.networkLogs,
37
- interactiveDebugging: bsCaps.interactiveDebugging,
38
- }
39
- }]
40
- }
41
- };
55
+ capabilities: [
56
+ {
57
+ browserName: bsCaps.browserName || 'chrome',
58
+ browserVersion: bsCaps.browserVersion,
59
+ 'bstack:options': bstackOptions,
60
+ },
61
+ ],
62
+ };
63
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "7.0.89",
3
+ "version": "7.0.91",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",