froth-webdriverio-framework 6.0.51 → 6.0.56

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,39 +1,56 @@
1
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.BROWSERSTACK_BUILD_NAME || 'local-build',
14
- browserstackLocal: false,
15
- opts: {
16
- forcelocal: false,
17
- localIdentifier: `wdio-${process.pid}`,
2
+ //const commonHooks = require('../commonhook');
3
+ const setAllDetails = require('../setallDatailinBuffer');
4
+
5
+ function preRequisite() {
6
+ setAllDetails.setEnvVariables();
7
+ const getExeDetails = setAllDetails.setExecutionDetails();
8
+ // console.log("app url in prerequisite;" + getExeDetails.app_url)
9
+ const appurl = process.env.BROWSERSTACK_APP_PATH || getExeDetails.app_url
10
+ console.log("app utl is" + appurl)
11
+ // getExeDetails.app_url=process.env.BROWSERSTACK_APP_PATH
12
+ return appurl
13
+ }
14
+
15
+ module.exports = (bsCaps) => {
16
+ const appPath = preRequisite();
17
+ return {
18
+ //...commonHooks,
19
+ user: bsCaps.userName,
20
+ key: Buffer.from(bsCaps.accessKey, 'base64').toString('utf-8'),
21
+
22
+ services: [
23
+ [
24
+ 'browserstack',
25
+ {
26
+ buildIdentifier: process.env.BROWSERSTACK_BUILD_NAME || 'local-build',
27
+ browserstackLocal: false,
28
+ opts: {
29
+ forcelocal: false,
30
+ localIdentifier: `wdio-${process.pid}`,
31
+ },
32
+ app: appPath,
18
33
  },
19
- app: process.env.BROWSERSTACK_APP_PATH||'bs://30fdf3a163d0bad126f64a3d5713e9ab0086a41e',
20
- },
34
+ ],
21
35
  ],
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
- });
36
+
37
+
38
+ capabilities: [{
39
+ platformName: bsCaps.platformName || 'Android',
40
+ //'appium:app': appPath,
41
+ 'bstack:options': {
42
+ projectName: 'BrowserStack Samples',
43
+ buildName: 'browserstack build',
44
+ sessionName: 'Mobile Test',
45
+ deviceName: bsCaps.deviceName || 'Samsung Galaxy S22 Ultra',
46
+ osVersion: bsCaps.platformVersion || '12.0',
47
+ debug: bsCaps.debug,
48
+ networkLogs: bsCaps.networkLogs,
49
+ interactiveDebugging: bsCaps.interactiveDebugging,
50
+
51
+ }
52
+ }],
53
+
54
+ updateJob: false
55
+ };
56
+ }
@@ -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==undefined?'':getExeDetails.app_url;
67
67
  process.env.MEDIA_FILES = JSON.stringify(getExeDetails.mediaurls);
68
68
  console.log("Execution Details:", JSON.stringify(getExeDetails));
69
69
 
@@ -68,3 +68,28 @@ if (PLATFORM === 'browserstack') {
68
68
 
69
69
  exports.config = deepmerge(baseConfig, envConfig(bsCaps));
70
70
 
71
+ // Merge base + env config
72
+ //const finalConfig = deepmerge(baseConfig, envConfig(bsCaps));
73
+
74
+ // --------------------
75
+ // Before session hook to dynamically update app
76
+ // --------------------
77
+ // finalConfig.beforeSession = async function (config, capabilities, specs) {
78
+ // if (OS === 'mobile') {
79
+ // console.log('====> Updating app before session');
80
+ // await setAllDetails.setEnvVariables();
81
+ // getExeDetails = await setAllDetails.setExecutionDetails();
82
+ // await setAllDetails.setSuiteDetails();
83
+ // await setAllDetails.setTestDataDetails();
84
+
85
+ // // const appPath = process.env.BROWSERSTACK_APP_PATH || bsCaps.app;
86
+ // // // Find the browserstack service object
87
+ // // const bsService = config.services.find(s => Array.isArray(s) && s[0] === 'browserstack');
88
+ // // if (bsService && bsService[1]) {
89
+ // // bsService[1].app = process.env.BROWSERSTACK_APP_PATH || bsCaps.app;
90
+ // // console.log('====> App path set to:', bsService[1].app);
91
+ // // }
92
+ // };
93
+ // }
94
+
95
+ //exports.config = finalConfig;