froth-webdriverio-framework 3.0.82 → 3.0.84

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.
@@ -133,31 +133,4 @@ async function swipetofit() {
133
133
  }
134
134
 
135
135
 
136
-
137
- // async function swipetofit() {
138
- // try {
139
- // const { width, height } = await driver.getWindowRect();
140
-
141
- // console.log('width and height:', width, height);
142
- // // ⬅ Swipe from right to left (Full Swipe)
143
-
144
- // await driver.touchAction([
145
- // { action: 'press', x: width - 10, y: height / 2 }, // Start near the right edge
146
- // { action: 'wait', ms: 500 }, // Hold to stabilize
147
- // { action: 'moveTo', x: 10, y: height / 2 }, // Move to the left edge
148
- // { action: 'release' }
149
- // ]);
150
- // // ⬅ Swipe from Left to Right (Full Swipe)
151
-
152
- // await driver.touchAction([
153
- // { action: 'press', x: 10, y: height / 2 }, // Start near the left edge
154
- // { action: 'wait', ms: 500 },
155
- // { action: 'moveTo', x: width - 10, y: height / 2 }, // Move to the right edge
156
- // { action: 'release' }
157
- // ]);
158
-
159
- // } catch (error) {
160
- // console.error(error.message);
161
- // }
162
- // }
163
136
  module.exports = { swipeleft, swipedown, swiperight, swipeup, swipetofit ,swipewithcoordinates};
@@ -1,10 +1,11 @@
1
+ const path = require('path');
2
+ global.BUFFER = new LocalStorage('./storage');
1
3
  const setAllDetails = require("./setallDatailinBuffer")
2
4
  const { LocalStorage } = require('node-localstorage');
3
- global.BUFFER = new LocalStorage('./storage');
4
- const path = require('path');
5
5
  const exeDetails = require("../api/getexecutionDetails")
6
6
  const getBSSessionDetails = require("../api/browsersatckSessionInfo").getBSSessionDetails;
7
7
  const { fail } = require("assert");
8
+ const { platform } = require("os");
8
9
  //const isBrowserStackEnabled = process.env.BROWSERSTACK;
9
10
  let starttime;
10
11
  let endtime;
@@ -23,7 +24,7 @@ const commonconfig = {
23
24
  // await setAllDetails.setIntegrationsDetails();
24
25
  await setAllDetails.setSuiteDetails();
25
26
  await setAllDetails.setTestDataDetails();
26
- console.log("on prepare:",JSON.stringify(capabilities))
27
+ console.log("on prepare:", JSON.stringify(capabilities))
27
28
  // console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
28
29
  } catch (e) {
29
30
  console.log("====> Error in onPrepare:", e);
@@ -36,14 +37,15 @@ const commonconfig = {
36
37
  console.log('====> This is the beforesession hook');
37
38
  // Perform any setup or pre-test actions here
38
39
  // console.log("Capabilities:", capabilities);
39
-
40
+
40
41
  console.log("specdat:", specs);
41
42
  console.log("length:", specs.length);
42
- console.log("capabilities:", capabilities);
43
- // capabilities.app = process.env.APP_PATH; // Replace with actual path
44
- console.log("====>",capabilities)
43
+ // console.log("capabilities:", capabilities);
44
+ capabilities.app = process.env.BROWSERSTACK_APP_PATH;
45
+ capabilities['browserstack.uploadMedia'] = process.env.MEDIA_FILES;
46
+ // console.log("====>",capabilities)
45
47
  console.log(`Running tests on: ${capabilities.platformName} ${capabilities.browserName} ${capabilities.browserVersion}`);
46
-
48
+
47
49
 
48
50
  // console.log('specs:', specs);
49
51
  // console.log("Config:", config);
@@ -58,10 +60,9 @@ const commonconfig = {
58
60
 
59
61
  starttime = new Date().getTime();
60
62
 
61
- // if (isBrowserStackEnabled) {
62
- console.log("BrowserStack is enabled");
63
- await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
64
- // }
63
+ if (platform === 'browserstack')
64
+ await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
65
+
65
66
  const resultdetails = {};
66
67
  exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
67
68
 
@@ -158,7 +159,7 @@ const commonconfig = {
158
159
  afterSession: async function (config, capabilities, specs) {
159
160
  console.log('====> This is the aftersession hook');
160
161
  // Perform any cleanup or post-test actions here
161
- console.log("Capabilities:", capabilities);
162
+ // console.log("Capabilities:", capabilities);
162
163
  console.log("Specs:", specs);
163
164
  console.log("Config:", config);
164
165
 
@@ -166,7 +167,7 @@ const commonconfig = {
166
167
  let totalDuration = endtime - starttime;
167
168
  console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
168
169
 
169
- // if (isBrowserStackEnabled)
170
+ if (platform === 'browserstack')
170
171
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
171
172
 
172
173
  const resultdetails = {}
@@ -178,39 +179,39 @@ const commonconfig = {
178
179
  BUFFER.clear();
179
180
 
180
181
 
181
- // Perform any cleanup or post-test actions here
182
- },
182
+ // Perform any cleanup or post-test actions here
183
+ },
183
184
 
184
- onComplete: async function (exitCode, config, capabilities, results) {
185
+ onComplete: async function (exitCode, config, capabilities, results) {
185
186
 
186
- console.log('====> This is the onComplete hook', results);
187
+ console.log('====> This is the onComplete hook', results);
187
188
 
188
- console.log('====> Test Results Summary ');
189
- console.log('----------------------------');
189
+ console.log('====> Test Results Summary ');
190
+ console.log('----------------------------');
190
191
 
191
- console.log('Total Tests:', results.total);
192
- console.log('Passed:', results.passed);
193
- console.log('Failed:', results.failed);
194
- console.log('Skipped:', results.skipped);
195
- console.log('Execution Time:', results.duration);
196
- console.log('Exit Code:', exitCode);
197
- console.log('====> All tests are done, exiting the browser session.');
192
+ console.log('Total Tests:', results.total);
193
+ console.log('Passed:', results.passed);
194
+ console.log('Failed:', results.failed);
195
+ console.log('Skipped:', results.skipped);
196
+ console.log('Execution Time:', results.duration);
197
+ console.log('Exit Code:', exitCode);
198
+ console.log('====> All tests are done, exiting the browser session.');
198
199
 
199
- }
200
+ }
200
201
 
201
- };
202
+ };
202
203
 
203
- async function secondsToTime(secs) {
204
- let hours = Math.floor(secs / 3600);
205
- let minutes = Math.floor((secs % 3600) / 60);
206
- let seconds = secs % 60;
204
+ async function secondsToTime(secs) {
205
+ let hours = Math.floor(secs / 3600);
206
+ let minutes = Math.floor((secs % 3600) / 60);
207
+ let seconds = secs % 60;
207
208
 
208
- // Adding leading zeros if the value is less than 10
209
- if (hours < 10) hours = '0' + hours;
210
- if (minutes < 10) minutes = '0' + minutes;
211
- if (seconds < 10) seconds = '0' + seconds;
212
- console.log("Time:" + hours + ':' + minutes + ':' + seconds);
213
- return hours + ':' + minutes + ':' + seconds;
209
+ // Adding leading zeros if the value is less than 10
210
+ if (hours < 10) hours = '0' + hours;
211
+ if (minutes < 10) minutes = '0' + minutes;
212
+ if (seconds < 10) seconds = '0' + seconds;
213
+ console.log("Time:" + hours + ':' + minutes + ':' + seconds);
214
+ return hours + ':' + minutes + ':' + seconds;
214
215
  }
215
216
 
216
217
  async function convertTimetoHHMMSS(time) {
@@ -6,13 +6,12 @@ const commonconfig = require('./commonconfig');
6
6
 
7
7
  // Select platform at runtime
8
8
  const PLATFORM = process.env.PLATFORM || 'browserstack';
9
- const configFile = PLATFORM === 'browserstack' ? './ymls/browserstack/' + process.env.YML_NAME : '../ymls/saucelab/' + process.env.YML_NAME;
9
+ const configFile = PLATFORM === 'browserstack' ? './ymls/browserstack/' + process.env.YML_NAME : './ymls/saucelab/' + process.env.YML_NAME;
10
10
  console.log('PLATFORM:', PLATFORM);
11
11
  // Load YAML file
12
12
  const capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(),configFile)), 'utf8'));
13
13
  const SUITE_FILE = path.resolve(process.cwd(), process.env.SUITE);
14
14
 
15
- //const SUITE_FILE = process.env.SUITE;
16
15
  console.log('SUITE_FILE:', SUITE_FILE);
17
16
 
18
17
  capabilities.buildName = process.env.BROWSERSTACK_BUILD_NAME;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.82",
3
+ "version": "3.0.84",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
@@ -45,8 +45,6 @@
45
45
  "mysql2": "^3.10.2",
46
46
  "node-fetch": "^3.3.2",
47
47
  "node-localstorage": "^3.0.5",
48
- "pg": "^8.12.0",
49
- "pg-promise": "^11.9.0",
50
48
  "randexp": "^0.5.3",
51
49
  "ts-node": "^10.9.2",
52
50
  "typescript": "^5.4.5"
@@ -1,49 +0,0 @@
1
- const deepmerge = require('deepmerge')
2
- process.env.BROWSERSTACK = true;
3
- const commonmobileconfig = require('./common.mobile.conf');
4
-
5
- const androidConfig = deepmerge.all([commonmobileconfig, {
6
- services: [
7
- [
8
- 'browserstack',
9
- {
10
- // testObservability: true,
11
- // buildName: "ANDROID BUILD",
12
- // buildIdentifier: "ANDROID BUILD_" + process.env.BUILD_NUMBER,
13
- browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
14
- opts: {
15
- forcelocal: false
16
- },
17
- app: process.env.BROWSERSTACK_APP_PATH
18
- }
19
- ]
20
- ],
21
-
22
- capabilities: [{
23
- 'bstack:options': {
24
- projectName: process.env.PROJECTNAME || "roboticodigital",
25
-
26
- deviceName: process.env.DEVICENAME || 'Samsung Galaxy S23 Ultra',
27
- platformVersion: process.env.OSVERSION || '13.0',
28
- platformName: 'android',
29
- interactiveDebugging: true,
30
- buildName: process.env.BROWSERSTACK_BUILD_NAME || 'Android_Build',
31
- networkLogs: "true",
32
- debug: "true",
33
- appProfiling: "true",
34
- //enableCameraImageInjection: true,
35
- // enableCameraVideoInjection: true,
36
- deviceOrientation: process.env.DEVICENAME.toLowerCase().includes('tab') ? 'landscape' : 'portrait',
37
- }
38
- }],
39
- before: function (capabilities, specs) {
40
- process.env.BS_SESSION_TYPE = "app-automate";
41
- },
42
-
43
- }]);
44
-
45
-
46
-
47
- module.exports = androidConfig;
48
-
49
-
@@ -1,76 +0,0 @@
1
- const deepmerge = require('deepmerge')
2
- const commonmobileconfig = require('./common.mobile.conf');
3
-
4
- const apiconfig = deepmerge.all([commonmobileconfig, {
5
-
6
-
7
- services: [
8
- ['browserstack', {
9
-
10
- browserstackLocal: process.env.BROWSERSTACK_LOCAL || false,
11
- opts: {
12
- forcelocal: false,
13
- // localIdentifier: "webdriverio-appium"
14
- },
15
-
16
- }]
17
- ],
18
- // ====================
19
- // Capabilities
20
- // ====================
21
- capabilities: [
22
- {
23
- 'bstack:options': {
24
- projectName: process.env.PROJECTNAME || "roboticodigital",
25
-
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
- os_version: '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 = apiconfig;
@@ -1,77 +0,0 @@
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;
@@ -1,45 +0,0 @@
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,5 +0,0 @@
1
- const F = require('../commonMethods/Utils.js');
2
-
3
-
4
- module.exports = { F };
5
-
@@ -1,4 +0,0 @@
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"}}')
@@ -1,47 +0,0 @@
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,76 +0,0 @@
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;
@@ -1,70 +0,0 @@
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;
File without changes