froth-webdriverio-framework 3.0.109 → 3.0.111

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.
Files changed (31) hide show
  1. package/.github/workflows/main.yml +23 -0
  2. package/{froth_api_calls → api}/browsersatckSessionInfo.js +4 -8
  3. package/{froth_api_calls → api}/getexecutionDetails.js +17 -20
  4. package/{froth_api_calls → api}/getsuiteDetails.js +10 -10
  5. package/{froth_api_calls → api}/loginapi.js +4 -2
  6. package/{froth_api_calls → api}/readTestdata.js +1 -1
  7. package/{froth_common_actions → commonMethods}/Utils.js +9 -21
  8. package/{froth_common_actions → commonMethods}/alert.js +3 -3
  9. package/{froth_common_actions → commonMethods}/apicall.js +5 -17
  10. package/{froth_common_actions → commonMethods}/click.js +1 -24
  11. package/{froth_common_actions → commonMethods}/jwt.js +3 -3
  12. package/{froth_common_actions → commonMethods}/scroll.js +1 -23
  13. package/commonMethods/swipe.js +59 -0
  14. package/config/android.conf.js +49 -0
  15. package/config/api.conf.bs.js +76 -0
  16. package/config/api.conf.js +77 -0
  17. package/config/common.mobile.conf.js +45 -0
  18. package/{froth_configs → config}/commonconfig.js +37 -66
  19. package/config/injectimage.js +4 -0
  20. package/config/ios.conf.js +47 -0
  21. package/{froth_configs → config}/setallDatailinBuffer.js +13 -15
  22. package/config/web.conf.bs.js +76 -0
  23. package/config/web.conf.js +70 -0
  24. package/package.json +6 -5
  25. package/froth_common_actions/swipe.js +0 -219
  26. package/froth_configs/wdio.common.conf.js +0 -74
  27. /package/{froth_api_calls → api}/aesEncryption.js +0 -0
  28. /package/{froth_common_actions → commonMethods}/assert.js +0 -0
  29. /package/{froth_common_actions → commonMethods}/dropDown.js +0 -0
  30. /package/{froth_common_actions → commonMethods}/random.js +0 -0
  31. /package/{froth_common_actions → commonMethods}/storeToBuffer.js +0 -0
@@ -0,0 +1,77 @@
1
+ const deepmerge = require('deepmerge')
2
+ process.env.BROWSERSTACK = true;
3
+ const commonmobileconfig = require('./common.mobile.conf');
4
+
5
+ const apiconfig = deepmerge.all([commonmobileconfig, {
6
+
7
+
8
+ services: [
9
+ ['browserstack', {
10
+
11
+ browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
12
+ opts: {
13
+ forcelocal: false,
14
+ // localIdentifier: "webdriverio-appium"
15
+ },
16
+
17
+ }]
18
+ ],
19
+ // ====================
20
+ // Capabilities
21
+ // ====================
22
+ capabilities: [
23
+ {
24
+ 'bstack:options': {
25
+ projectName: process.env.PROJECTNAME || "roboticodigital",
26
+
27
+ browserName: 'chrome', // Choose the browser you want to test
28
+ // browserVersion: '129', // Specify the browser version
29
+ os: 'Windows', // Specify the operating system
30
+ // os_version: '10', // Specify the operating system version
31
+ interactiveDebugging: true,
32
+ buildName: process.env.BROWSERSTACK_BUILD_NAME || 'WEB_Build',
33
+ networkLogs: "true",
34
+ debug: "true",
35
+ }
36
+ },
37
+ // Add more capabilities for other browsers or devices as needed
38
+ ],
39
+
40
+ // ====================
41
+ // Test Configurations
42
+ // ====================
43
+ // logLevel: 'info', // Set the log level
44
+ // bail: 0, // Set to 1 to stop the test suite after the first test failure
45
+ // baseUrl: '', // Specify the base URL of your application
46
+ // waitforTimeout: 90000, // Set the timeout for all waitFor* commands
47
+ // connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
48
+ // connectionRetryCount: 2, // Set the number of times to retry the entire spec file
49
+
50
+ // ====================
51
+ // Framework
52
+ // ====================
53
+ // framework: 'mocha', // Use the Mocha framework
54
+ // reporters: ['spec'
55
+
56
+ // ], // Use the spec reporter
57
+
58
+ // ====================
59
+ // Hooks
60
+ // ====================
61
+ before: function (capabilities, specs) {
62
+ browser.maximizeWindow()
63
+ process.env.BS_SESSION_TYPE = "automate";
64
+ },
65
+
66
+
67
+
68
+ // // ====================
69
+ // // Mocha Options
70
+ // // ====================
71
+ // mochaOpts: {
72
+ // ui: 'bdd', // Set the test interface to BDD
73
+ // timeout: 90000, // Set the timeout for test cases in milliseconds
74
+ // },
75
+ }]);
76
+
77
+ module.exports = apiconfig;
@@ -0,0 +1,45 @@
1
+ const deepmerge = require('deepmerge')
2
+ const commonconfig = require('./commonconfig');
3
+ const isBrowserStackEnabled = process.env.BROWSERSTACK;
4
+ console.log("isBrowserStackEnabled", isBrowserStackEnabled);
5
+
6
+ const browserStackConfig = isBrowserStackEnabled === 'true' ? {
7
+ user: process.env.BROWSERSTACK_USERNAME,
8
+ key: Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8'),
9
+ commonCapabilities: {
10
+ 'bstack:options': {
11
+ projectName: process.env.PROJECTNAME || "roboticodigital",
12
+ sessionName: 'Automation test session',
13
+ debug: true,
14
+ networkLogs: true
15
+ }
16
+ }
17
+ }: {};
18
+
19
+ const commonmobconfig = deepmerge.all([
20
+
21
+ {
22
+ logLevel: 'info',
23
+ coloredLogs: true,
24
+ screenshotPath: './errorShots/',
25
+ baseUrl: '',
26
+ waitforTimeout: 90000,
27
+ connectionRetryTimeout: 90000,
28
+ connectionRetryCount: 2,
29
+
30
+ framework: 'mocha',
31
+ mochaOpts: {
32
+ ui: 'bdd',
33
+ timeout: 300000
34
+ },
35
+
36
+ maxInstances: 10,
37
+
38
+ updateJob: false,
39
+ reporters: ['spec'],
40
+ },
41
+ browserStackConfig,
42
+ commonconfig,
43
+ ]);
44
+
45
+ module.exports = commonmobconfig;
@@ -1,65 +1,45 @@
1
- const path = require('path');
1
+ const setAllDetails = require("./setallDatailinBuffer")
2
2
  const { LocalStorage } = require('node-localstorage');
3
3
  global.BUFFER = new LocalStorage('./storage');
4
- const setAllDetails = require("./setallDatailinBuffer")
5
- const exeDetails = require("../froth_api_calls/getexecutionDetails")
6
- const getBSSessionDetails = require("../froth_api_calls/browsersatckSessionInfo").getBSSessionDetails;
4
+ const path = require('path');
5
+ const exeDetails = require("../api/getexecutionDetails")
6
+ const getBSSessionDetails = require("../api/browsersatckSessionInfo").getBSSessionDetails;
7
7
  const { fail } = require("assert");
8
- //const isBrowserStackEnabled = process.env.BROWSERSTACK;
8
+ const isBrowserStackEnabled = process.env.BROWSERSTACK;
9
9
  let starttime;
10
10
  let endtime;
11
- console.log('===== common config===== ');
12
11
 
13
12
  // Description: This file contains the common configuration for the webdriverio framework.
14
13
  const commonconfig = {
15
14
 
16
15
 
17
16
  onPrepare: async function (capabilities, specs) {
18
- try {
19
- console.log('==== ON PREPARE HOOK ====');
20
- // This code runs before the test suite starts
21
- await setAllDetails.setEnvVariables();
22
- await setAllDetails.setLoginToken();
23
- await setAllDetails.setExecutionDetails();
24
-
25
- // await setAllDetails.setIntegrationsDetails();
26
- await setAllDetails.setSuiteDetails();
27
- await setAllDetails.setTestDataDetails();
28
- console.log("on prepare:", JSON.stringify(capabilities))
29
- // console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
30
- } catch (e) {
31
- console.log("====> Error in onPrepare:", e);
17
+ try{
18
+ // This code runs before the test suite starts
19
+ await setAllDetails.setEnvVariables();
20
+ await setAllDetails.setLoginToken();
21
+ await setAllDetails.setExecutionDetails();
22
+ // await setAllDetails.setIntegrationsDetails();
23
+ await setAllDetails.setSuiteDetails();
24
+ await setAllDetails.setTestDataDetails();
25
+ // console.log(JSON.stringify(capabilities))
26
+ // console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
27
+ }catch(e){
28
+ console.log("====> Error in onPrepare:",e);
32
29
 
33
30
  }
34
31
  },
35
32
 
36
33
 
37
- beforeSession: async function (config, capabilities, specs) {
38
- console.log('==== BEFORE SESSION HOOK ====');
34
+ beforeSession: async function (config, capabilities,specs ) {
35
+ console.log('====> This is the beforesession hook');
39
36
  // Perform any setup or pre-test actions here
40
- // console.log("Capabilities:", capabilities);
41
-
42
- console.log("specdat:", specs);
43
- console.log("length:", specs.length);
44
-
45
- if (process.env.PLATFORM === 'browserstack') {
46
- /// console.log("capabilities:", capabilities);
47
- capabilities.browserstackLocal = process.env.BROWSERSTACK_LOCAL;
48
- // capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
49
- if (process.env.BROWSERSTACK_APP_PATH)
50
- capabilities.app = process.env.BROWSERSTACK_APP_PATH;
51
-
52
-
53
- if (process.env.MEDIA_FILES) {
54
- console.log("Media Files:", JSON.parse(process.env.MEDIA_FILES));
55
- console.log("Size of Media Files:", process.env.MEDIA_FILES.length);
56
- if (process.env.MEDIA_FILES.length > 0)
57
- capabilities['browserstack.uploadMedia'] = JSON.parse(process.env.MEDIA_FILES);
58
- }
59
-
60
- console.log(`Running tests on after app,bslocal,mediafiles: ${JSON.stringify(capabilities)}`);
61
- }
62
-
37
+ // console.log("Capabilities:", capabilities);
38
+ console.log("Specs:", specs.length);
39
+ const specdat=specs
40
+ console.log("specdat:", specdat);
41
+ console.log("length:", specdat.length);
42
+ // console.log("Config:", config);
63
43
  },
64
44
  /**
65
45
  * Gets executed before the suite starts (in Mocha/Jasmine only).
@@ -67,17 +47,16 @@ const commonconfig = {
67
47
  */
68
48
  beforeSuite: async function (suite) {
69
49
  try {
70
- console.log('==== BEFORE SUITE HOOK ====');
71
-
72
50
  console.log(`====> Test suite has been started ' ${suite.title}' `,);
73
51
 
74
52
  starttime = new Date().getTime();
75
53
 
76
- if (process.env.PLATFORM === 'browserstack')
54
+ if (isBrowserStackEnabled) {
55
+ console.log("BrowserStack is enabled");
77
56
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
78
-
57
+ }
79
58
  const resultdetails = {};
80
- await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
59
+ exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
81
60
 
82
61
  } catch (e) {
83
62
  console.log("Error in beforeSuite:", e);
@@ -90,7 +69,6 @@ const commonconfig = {
90
69
  * @param {object} context scope object the test was executed with
91
70
  */
92
71
  beforeTest: function (test, context) {
93
- console.log('==== BEFORE TEST HOOK ====');
94
72
  console.log(`====> Test Started '${test.title}'`);
95
73
 
96
74
  // console.log("File Name:", test.file);
@@ -109,8 +87,6 @@ const commonconfig = {
109
87
  * @param {object} result.retries information about spec related retries, e.g. `{ attempts: 0, limit: 0 }`
110
88
  */
111
89
  afterTest: async function (test, context, { error, result, duration, passed, retries }) {
112
- console.log('==== AFTER TEST HOOK ====');
113
-
114
90
  console.log(`====> Test name finished '${test.title}'`);
115
91
 
116
92
  const fileName = path.basename(test.file);
@@ -132,7 +108,7 @@ const commonconfig = {
132
108
  // scriptresult = "FAILED"
133
109
  }
134
110
  let scriptid = BUFFER.getItem(fileName.replace(".js", ""))
135
- let script_platform = BUFFER.getItem(fileName.replace(".js", "") + "_PLATFORM")
111
+ let script_platform = BUFFER.getItem(fileName.replace(".js", "")+"_PLATFORM")
136
112
 
137
113
  await exeDetails.updateScriptExecutionStatus(
138
114
  BUFFER.getItem("ORGANISATION_DOMAIN_URL"),
@@ -147,8 +123,6 @@ const commonconfig = {
147
123
  * @param {object} suite suite details
148
124
  */
149
125
  afterSuite: function (suite) {
150
- console.log('==== AFTER SUITE HOOK ====');
151
-
152
126
  console.log(`====> Test suite has completed '${suite.title}'`);
153
127
  },
154
128
  /**
@@ -159,8 +133,6 @@ const commonconfig = {
159
133
  * @param {Array.<String>} specs List of spec file paths that ran
160
134
  */
161
135
  after: async function (result, config, capabilities, specs) {
162
- console.log('==== AFTER HOOK ====');
163
-
164
136
  console.log('====> All tests are completed.' + result);
165
137
 
166
138
  BUFFER.setItem("RESULT_DATA", result);
@@ -177,11 +149,9 @@ const commonconfig = {
177
149
  },
178
150
 
179
151
  afterSession: async function (config, capabilities, specs) {
180
- console.log('==== AFTER SESSION HOOK ====');
181
-
182
152
  console.log('====> This is the aftersession hook');
183
153
  // Perform any cleanup or post-test actions here
184
- // console.log("Capabilities:", capabilities);
154
+ console.log("Capabilities:", capabilities);
185
155
  console.log("Specs:", specs);
186
156
  console.log("Config:", config);
187
157
 
@@ -189,7 +159,7 @@ const commonconfig = {
189
159
  let totalDuration = endtime - starttime;
190
160
  console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
191
161
 
192
- if (process.env.PLATFORM === 'browserstack')
162
+ if (isBrowserStackEnabled)
193
163
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
194
164
 
195
165
  const resultdetails = {}
@@ -205,18 +175,19 @@ const commonconfig = {
205
175
  },
206
176
 
207
177
  onComplete: async function (exitCode, config, capabilities, results) {
208
- console.log('==== ON COMPLETE HOOK ====');
178
+
179
+ console.log('====> This is the onComplete hook', results);
209
180
 
210
- console.log('====> Results:', results);
181
+ console.log('====> Test Results Summary ');
182
+ console.log('----------------------------');
211
183
 
212
- console.log('==== Test Results Summary ======');
213
184
  console.log('Total Tests:', results.total);
214
185
  console.log('Passed:', results.passed);
215
186
  console.log('Failed:', results.failed);
216
187
  console.log('Skipped:', results.skipped);
217
188
  console.log('Execution Time:', results.duration);
218
189
  console.log('Exit Code:', exitCode);
219
- console.log('==== ALL TESTS ARE COMPLETED ====');
190
+ console.log('====> All tests are done, exiting the browser session.');
220
191
 
221
192
  }
222
193
 
@@ -0,0 +1,4 @@
1
+
2
+ await driver.execute('browserstack_executor: {"action":"cameraImageInjection", "arguments": {"imageUrl" : "media://1965674f959d00128d4fb649dcc6823bd00b00cb"}}');
3
+
4
+ await driver.execute('browserstack_executor: {"action":"cameraVideoInjection", "arguments": {"videoUrl" : "media://1920c80136e1c7e2278e15d820845ed64a676e92"}}')
@@ -0,0 +1,47 @@
1
+ // This is the configuration file for iOS devices
2
+ const deepmerge = require('deepmerge')
3
+ process.env.BROWSERSTACK = true;
4
+ const commonmobileconfig = require('./common.mobile.conf');
5
+
6
+ const iosconfig = deepmerge.all([commonmobileconfig, {
7
+ services: [
8
+ [
9
+ 'browserstack',
10
+ {
11
+ // testObservability: true,
12
+ // buildIdentifier: `#${process.env.BUILD_NUMBER}`,
13
+ browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
14
+ opts: {
15
+ forcelocal: false,
16
+ // localIdentifier: "webdriverio-appium"
17
+ },
18
+ app: process.env.BROWSERSTACK_APP_PATH || 'bs://d6588d0899a2ac5c485d4784af9ad28d06b98c44'
19
+ }
20
+ ]
21
+ ],
22
+
23
+ capabilities: [{
24
+ 'bstack:options': {
25
+ projectName: process.env.PROJECTNAME || "roboticodigital",
26
+ deviceName: process.env.DEVICENAME || "iPhone 15 Pro Max",
27
+ osVersion: process.env.OSVERSION || "17",
28
+ platformName: 'iOS',
29
+ interactiveDebugging: true,
30
+ buildName: process.env.BROWSERSTACK_BUILD_NAME || 'IOS_Build',
31
+ networkLogs: "true",
32
+ debug: "true",
33
+ appProfiling: "true",
34
+ //enableCameraImageInjection: "true",
35
+ deviceOrientation: process.env.DEVICENAME.toLowerCase().includes('tab') ? 'landscape' : 'portrait',
36
+
37
+ }
38
+ }],
39
+
40
+ before: function (capabilities, specs) {
41
+ // browser.maximizeWindow()
42
+ process.env.BS_SESSION_TYPE = "app-automate";
43
+ },
44
+ }]);
45
+
46
+ module.exports = iosconfig;
47
+
@@ -1,8 +1,9 @@
1
- const getLoginToken = require("../froth_api_calls/loginapi");
2
- const exeDetails = require("../froth_api_calls/getexecutionDetails")
3
- //const getintegrationdetails = require("../froth_api_calls/getintegrationDetails");
4
- const getSuiteDetails = require("../froth_api_calls/getsuiteDetails");
5
- const getDataById = require("../froth_api_calls/readTestdata");
1
+ const getLoginToken = require("../api/loginapi");
2
+ const exeDetails = require("../api/getexecutionDetails")
3
+ //const getintegrationdetails = require("../api/getintegrationDetails");
4
+ const getSuiteDetails = require("../api/getsuiteDetails");
5
+ const getDataById = require("../api/readTestdata");
6
+
6
7
 
7
8
  async function generateBuildNumber() {
8
9
  try {
@@ -42,7 +43,7 @@ async function setEnvVariables() {
42
43
  BUFFER.setItem("FROTH_INTEGRATION_ID", process.env.INTEGRATION_ID || 1);
43
44
  BUFFER.setItem("ORGANISATION_DOMAIN_URL", process.env.ORGANISATION_DOMAIN_URL || "https://devapi.frothtestops.com");
44
45
  BUFFER.setItem("SERVICE_USER", "frothbot@roboticodigital.com");
45
- BUFFER.setItem("SERVICE_PASSWORD", "Frothtestops@555");
46
+ BUFFER.setItem("SERVICE_PASSWORD", "WVUVh7fZ+zMyJqtoe846cEHL0gXJWUk99KzUPu7d6AQUBIw0Ytn01QYObWMDMPma");
46
47
 
47
48
 
48
49
  }
@@ -62,11 +63,7 @@ async function setLoginToken() {
62
63
  async function setExecutionDetails() {
63
64
  try {
64
65
  const getExeDetails = await exeDetails.getExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"));
65
- process.env.AUTOMATION_SUITE_ID= getExeDetails.automation_suite_id;
66
- process.env.BROWSERSTACK_LOCAL= getExeDetails.browser_stack_local;
67
- process.env.BROWSERSTACK_APP_PATH=getExeDetails.app_url;
68
- process.env.MEDIA_FILES=JSON.stringify( getExeDetails.mediaurls);
69
- console.log("Execution Details:", JSON.stringify(getExeDetails));
66
+ BUFFER.setItem("AUTOMATION_SUITE_ID", getExeDetails.automation_suite_id);
70
67
 
71
68
  } catch (error) {
72
69
  // console.error('Error in main function:', error);
@@ -76,9 +73,9 @@ async function setExecutionDetails() {
76
73
 
77
74
  async function setSuiteDetails() {
78
75
  try {
79
- const getSuiteDetail = await getSuiteDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), process.env.AUTOMATION_SUITE_ID);
80
- // process.env.BROWSERSTACK_APP_PATH = getSuiteDetail.browser_stack_urls;
81
- process.env.TESTDATA_ID= getSuiteDetail.test_data_id;
76
+ const getSuiteDetail = await getSuiteDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("AUTOMATION_SUITE_ID"));
77
+ process.env.BROWSERSTACK_APP_PATH = getSuiteDetail.browser_stack_urls;
78
+ BUFFER.setItem("TESTDATA_ID", getSuiteDetail.test_data_id);
82
79
 
83
80
 
84
81
  } catch (error) {
@@ -87,7 +84,7 @@ async function setSuiteDetails() {
87
84
  }
88
85
  async function setTestDataDetails() {
89
86
  try {
90
- const jsonobject = await getDataById(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), process.env.TESTDATA_ID);
87
+ const jsonobject = await getDataById(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("TESTDATA_ID"));
91
88
 
92
89
  } catch (error) {
93
90
  // console.error('Error in main function:', error);
@@ -97,6 +94,7 @@ module.exports = {
97
94
  setEnvVariables,
98
95
  setLoginToken,
99
96
  setExecutionDetails,
97
+ //setIntegrationsDetails,
100
98
  setSuiteDetails,
101
99
  setTestDataDetails
102
100
  };
@@ -0,0 +1,76 @@
1
+ const deepmerge = require('deepmerge')
2
+ process.env.BROWSERSTACK = true;
3
+ const commonmobileconfig = require('./common.mobile.conf');
4
+
5
+ const webbsconfig = deepmerge.all([commonmobileconfig, {
6
+
7
+
8
+ services: [
9
+ ['browserstack', {
10
+
11
+ browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
12
+ opts: {
13
+ forcelocal: false,
14
+ // localIdentifier: "webdriverio-appium"
15
+ },
16
+
17
+ }]
18
+ ],
19
+ // ====================
20
+ // Capabilities
21
+ // ====================
22
+ capabilities: [
23
+ {
24
+ 'bstack:options': {
25
+ projectName: process.env.PROJECTNAME || "roboticodigital",
26
+ browserName: process.env.BROWSERSTACK_BROWSER || 'chrome', // Choose the browser you want to test
27
+ browserVersion: process.env.BROWSERSTACK_BROWSER_VERSION || '129', // Specify the browser version
28
+ os: 'Windows', // Specify the operating system
29
+ osVersion: '10', // Specify the operating system version
30
+ interactiveDebugging: true,
31
+ buildName: process.env.BROWSERSTACK_BUILD_NAME || 'WEB_Build',
32
+ networkLogs: "true",
33
+ debug: "true",
34
+ }
35
+ },
36
+ // Add more capabilities for other browsers or devices as needed
37
+ ],
38
+
39
+ // ====================
40
+ // Test Configurations
41
+ // ====================
42
+ // logLevel: 'info', // Set the log level
43
+ // bail: 0, // Set to 1 to stop the test suite after the first test failure
44
+ // baseUrl: '', // Specify the base URL of your application
45
+ // waitforTimeout: 90000, // Set the timeout for all waitFor* commands
46
+ // connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
47
+ // connectionRetryCount: 2, // Set the number of times to retry the entire spec file
48
+
49
+ // ====================
50
+ // Framework
51
+ // ====================
52
+ // framework: 'mocha', // Use the Mocha framework
53
+ // reporters: ['spec'
54
+
55
+ // ], // Use the spec reporter
56
+
57
+ // ====================
58
+ // Hooks
59
+ // ====================
60
+ before: function (capabilities, specs) {
61
+ browser.maximizeWindow()
62
+ process.env.BS_SESSION_TYPE = "automate";
63
+ },
64
+
65
+
66
+
67
+ // // ====================
68
+ // // Mocha Options
69
+ // // ====================
70
+ // mochaOpts: {
71
+ // ui: 'bdd', // Set the test interface to BDD
72
+ // timeout: 90000, // Set the timeout for test cases in milliseconds
73
+ // },
74
+ }]);
75
+
76
+ module.exports = webbsconfig;
@@ -0,0 +1,70 @@
1
+
2
+
3
+ const config = {
4
+
5
+ // ====================
6
+ // Capabilities
7
+ // ====================
8
+ capabilities: [{
9
+ maxInstances: 5,
10
+ browserName: 'chrome',
11
+ acceptInsecureCerts: true,
12
+ }],
13
+
14
+ // ====================
15
+ // Test Configurations
16
+ // ====================
17
+ logLevel: 'info', // Set the log level
18
+ bail: 0, // Set to 1 to stop the test suite after the first test failure
19
+ baseUrl: '', // Specify the base URL of your application
20
+ waitforTimeout: 60000, // Set the timeout for all waitFor* commands
21
+ connectionRetryTimeout: 90000, // Set the timeout in milliseconds for test retries
22
+ connectionRetryCount: 3, // Set the number of times to retry the entire spec file
23
+
24
+ // ====================
25
+ // Framework
26
+ // ====================
27
+ framework: 'mocha', // Use the Mocha framework
28
+ reporters: ['spec'], // Use the spec reporter
29
+ // reporterOptions: {
30
+ // allure: {
31
+ // outputDir: 'allure-results',
32
+ // disableWebdriverStepsReporting: true,
33
+ // disableWebdriverScreenshotsReporting: false,
34
+ // }
35
+ //},
36
+ // ====================
37
+ // Hooks
38
+ // ====================
39
+ before: function (capabilities, specs) {
40
+ // Code to run before the first test
41
+ const currentDate = new Date();
42
+ const timestamp = currentDate.toISOString().replace(/[:.]/g, '');
43
+ browser.saveScreenshot('./screenshot_' + timestamp + '.png');
44
+
45
+ },
46
+ after: function (capabilities, specs) {
47
+ // Code to run to take screenshots
48
+ const currentDate = new Date();
49
+ const timestamp = currentDate.toISOString().replace(/[:.]/g, '');
50
+ browser.saveScreenshot('./screenshot_' + timestamp + '.png');
51
+
52
+
53
+ },
54
+
55
+ // ====================
56
+ // BrowserStack Options
57
+ // ====================
58
+ browserstackOpts: {
59
+ // BrowserStack-specific options
60
+ },
61
+
62
+ // ====================
63
+ // Mocha Options
64
+ // ====================
65
+ mochaOpts: {
66
+ ui: 'bdd', // Set the test interface to BDD
67
+ timeout: 60000, // Set the timeout for test cases in milliseconds
68
+ },
69
+ };
70
+ module.exports = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.109",
3
+ "version": "3.0.111",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
@@ -31,20 +31,21 @@
31
31
  "@wdio/local-runner": "^9.0.9",
32
32
  "@wdio/mocha-framework": "^8.36.1",
33
33
  "@wdio/spec-reporter": "^8.36.1",
34
- "appium": "^2.15.0",
35
- "appium-uiautomator2-driver": "^4.0.1",
34
+ "appium": "^1.22.3",
35
+ "appium-uiautomator2-driver": "^2.2.0",
36
36
  "assert": "^2.1.0",
37
37
  "axios": "^1.7.7",
38
38
  "browserstack-local": "^1.5.5",
39
39
  "chai": "^5.1.1",
40
+ "crypto": "^1.0.1",
40
41
  "crypto-js": "^4.2.0",
41
42
  "deepmerge": "^4.3.1",
42
43
  "form-data": "^4.0.0",
43
- "fs": "^0.0.1-security",
44
- "js-yaml": "^4.1.0",
45
44
  "mysql2": "^3.10.2",
46
45
  "node-fetch": "^3.3.2",
47
46
  "node-localstorage": "^3.0.5",
47
+ "pg": "^8.12.0",
48
+ "pg-promise": "^11.9.0",
48
49
  "randexp": "^0.5.3",
49
50
  "ts-node": "^10.9.2",
50
51
  "typescript": "^5.4.5"