froth-webdriverio-framework 4.0.50 → 4.0.52

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.
@@ -272,7 +272,10 @@ const commonconfig = {
272
272
  if (await isInvalidDuration(frothDuration)) {
273
273
  // console.log("inside froth duration");
274
274
  if (await isInvalidDuration(duration_tests)) {
275
- // console.log("inside froth duration_tests");
275
+ console.log("inside froth duration_tests");
276
+ resultdetails.excution_time = await millisecondsToTime(totalDuration);
277
+ } else {
278
+ console.log("inside froth duration_tests comparision");
276
279
  if (totalDuration > duration_tests)
277
280
  resultdetails.excution_time = await millisecondsToTime(totalDuration);
278
281
  else
@@ -3,8 +3,9 @@ const fs = require('fs');
3
3
  const yaml = require('js-yaml');
4
4
  const path = require('path');
5
5
  const commonconfig = require('./commonconfig');
6
- console.log('=====wdios common config===== ');
6
+ const exeDetails = require('../froth_api_calls/getexecutionDetails');
7
7
 
8
+ console.log('=====wdios common config===== ');
8
9
  // Select platform at runtime
9
10
  const PLATFORM = process.env.PLATFORM || 'browserstack';
10
11
  const configFile = process.env.YML_NAME || '../ymls/browserstack/android/android_caps.yml';
@@ -15,6 +16,33 @@ console.log('====>capabilities:', capabilities);
15
16
  const SUITE_FILE = path.resolve(process.cwd(), process.env.SUITE);
16
17
  console.log('====>SUITE_FILE:', SUITE_FILE);
17
18
 
19
+ const resultdetails = {
20
+ comments: [],
21
+ excution_status: null, // Pass/Fail
22
+ excution_time: null, // Execution time in milliseconds
23
+ };
24
+ if (!SUITE_FILE || !fs.existsSync(SUITE_FILE)) {
25
+ let errorMsg = `The suite file does not exist in the currently configured repository at path: ${SUITE_FILE}. Please update the SUITE by editing the file`;
26
+
27
+ console.error(errorMsg);
28
+ resultdetails.comments.push(errorMsg);
29
+
30
+ // Fire API call in background (non-blocking)
31
+ setTimeout(() => {
32
+ exeDetails.updateExecuitonDetails(
33
+ process.env.ORGANISATION_DOMAIN_URL,
34
+ process.env.API_TOKEN,
35
+ process.env.EXECUTION_ID,
36
+ resultdetails
37
+ ).catch(err => {
38
+ console.error('Failed to update execution details:', err.message);
39
+ });
40
+ }, 10000);
41
+
42
+ // Exit with failure
43
+ process.exit(1);
44
+ }
45
+
18
46
 
19
47
  function setupPrerequisites() {
20
48
  console.log("inside this fuction first ");
@@ -22,24 +50,24 @@ function setupPrerequisites() {
22
50
  process.env.BROWSERSTACK_USERNAME = capabilities.userName;
23
51
  capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
24
52
  process.env.BROWSERSTACK_ACCESS_KEY = capabilities.accessKey
25
-
53
+
26
54
  console.log('capabilities.platformName:', capabilities.platformName ?? 'web');
27
55
 
28
56
  process.env.BS_SESSION_TYPE = capabilities.platformName === 'android' || capabilities.platformName === 'ios' ? 'app-automate' : 'automate';
29
57
  capabilities.buildName = process.env.FROTH_TESTOPS_BUILD_NAME;
30
58
 
31
59
  }
32
-
60
+
33
61
  }
34
62
 
35
- const specificConfig = setupPrerequisites();
63
+ setupPrerequisites();
36
64
 
37
65
 
38
66
  exports.config = deepmerge(commonconfig,
39
67
 
40
68
  {
41
- user: process.env.BROWSERSTACK_USERNAME,
42
- key: process.env.BROWSERSTACK_ACCESS_KEY ,
69
+ user: process.env.BROWSERSTACK_USERNAME,
70
+ key: process.env.BROWSERSTACK_ACCESS_KEY,
43
71
  // debug: true,
44
72
  // execArgv: ['--inspect-brk'],
45
73
  services: PLATFORM === 'browserstack'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.50",
3
+ "version": "4.0.52",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",