froth-webdriverio-framework 4.0.52 → 4.0.53

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.
@@ -5,22 +5,48 @@ const path = require('path');
5
5
  const commonconfig = require('./commonconfig');
6
6
  const exeDetails = require('../froth_api_calls/getexecutionDetails');
7
7
 
8
+ const resultdetails = {
9
+ comments: [],
10
+ excution_status: null, // Pass/Fail
11
+ excution_time: null, // Execution time in milliseconds
12
+ };
13
+
14
+
8
15
  console.log('=====wdios common config===== ');
9
16
  // Select platform at runtime
10
17
  const PLATFORM = process.env.PLATFORM || 'browserstack';
11
- const configFile = process.env.YML_NAME || '../ymls/browserstack/android/android_caps.yml';
18
+ const configFile = process.env.YML_NAME;
12
19
  console.log('====>PLATFORM:', PLATFORM);
13
20
  // Load YAML file
14
- const capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(), configFile)), 'utf8'));
21
+ let capabilities;
22
+
23
+ try {
24
+ capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(), configFile)), 'utf8'));
25
+ } catch (e) {
26
+ const errorMsg = `The capability file does not exist in the currently configured repository at path: ${path.resolve(process.cwd(), configFile)}: ${e.message},Please update the Capability by editing the file`;
27
+ console.error(errorMsg);
28
+ resultdetails.comments.push(errorMsg);
29
+
30
+ setTimeout(() => {
31
+ exeDetails.updateExecuitonDetails(
32
+ process.env.ORGANISATION_DOMAIN_URL,
33
+ process.env.API_TOKEN,
34
+ process.env.EXECUTION_ID,
35
+ resultdetails
36
+ ).catch(err => {
37
+ console.error('Failed to update execution details:', err.message);
38
+ });
39
+ }, 10000);
40
+
41
+ process.exit(1);
42
+ }
43
+
15
44
  console.log('====>capabilities:', capabilities);
16
45
  const SUITE_FILE = path.resolve(process.cwd(), process.env.SUITE);
46
+
47
+
17
48
  console.log('====>SUITE_FILE:', SUITE_FILE);
18
49
 
19
- const resultdetails = {
20
- comments: [],
21
- excution_status: null, // Pass/Fail
22
- excution_time: null, // Execution time in milliseconds
23
- };
24
50
  if (!SUITE_FILE || !fs.existsSync(SUITE_FILE)) {
25
51
  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
52
 
@@ -53,7 +79,7 @@ function setupPrerequisites() {
53
79
 
54
80
  console.log('capabilities.platformName:', capabilities.platformName ?? 'web');
55
81
 
56
- process.env.BS_SESSION_TYPE = capabilities.platformName === 'android' || capabilities.platformName === 'ios' ? 'app-automate' : 'automate';
82
+ process.env.BS_SESSION_TYPE = ['android', 'ios'].includes(capabilities.platformName) ? 'app-automate' : 'automate';
57
83
  capabilities.buildName = process.env.FROTH_TESTOPS_BUILD_NAME;
58
84
 
59
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.52",
3
+ "version": "4.0.53",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",