froth-webdriverio-framework 1.0.38 → 1.0.40

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.
@@ -4,7 +4,7 @@ const getLoginToken = require("../api/loginapi.js")
4
4
 
5
5
  async function getExecuitonDetails(frothUrl, token, id) {
6
6
  let jsondata = {};
7
- if (id != 0) {
7
+ if (id != 0 || id != null || id != undefined) {
8
8
  const url = `https://${frothUrl}/api/test-execution-retrieve/${id}`;
9
9
 
10
10
  try {
@@ -49,7 +49,7 @@ async function getExecuitonDetails(frothUrl, token, id) {
49
49
 
50
50
  }
51
51
  } else {
52
- console.error('getExecuitonDetails Error fetching data: Invalid ID');
52
+ console.error('getExecuitonDetails Error fetching data: Invalid ID or not executionid is linked to the execution.');
53
53
  }
54
54
 
55
55
  }
@@ -2,7 +2,7 @@
2
2
  // Function to get data from the API using the Bearer token
3
3
  async function getintegrationdetails(frothUrl, token, id) {
4
4
  let jsondata = {};
5
- if ( id != 0) {
5
+ if (id != 0 || id != null || id != undefined) {
6
6
  const url = `https://${frothUrl}/api/intergration-view/${id}/`;
7
7
 
8
8
  try {
@@ -2,7 +2,7 @@
2
2
  // Function to get data from the API using the Bearer token
3
3
  async function getSuiteDetails(frothUrl, token, id) {
4
4
  let jsondata = {};
5
- if (id != 0) {
5
+ if (id != 0 || id != null || id != undefined) {
6
6
  const url = `https://${frothUrl}/api/automationsuite-retrieve/${id}/`;
7
7
 
8
8
  try {
@@ -45,7 +45,7 @@ async function getSuiteDetails(frothUrl, token, id) {
45
45
 
46
46
  }
47
47
  } else {
48
- console.error('Error fetching data: Invalid ID');
48
+ console.error('Error fetching data: Invalid ID or no suite id is linked to execution');
49
49
  }
50
50
 
51
51
  }
@@ -5,7 +5,7 @@ const getLoginToken = require('../api/loginapi.js');
5
5
  // Function to get data from the API using the Bearer token
6
6
  async function getDataById(frothUrl, token, id) {
7
7
 
8
- if (id != 0) {
8
+ if (id != 0 || id != null || id != undefined) {
9
9
  const url = `https://${frothUrl}/api/testdata-retrieve/${id}/`;
10
10
 
11
11
  try {
@@ -52,7 +52,7 @@ async function getDataById(frothUrl, token, id) {
52
52
 
53
53
  }
54
54
  } else {
55
- console.error('Error fetching data: Invalid ID');
55
+ console.error('Error fetching data: Invalid ID or no testdata linked to the execution.');
56
56
  }
57
57
 
58
58
  }
@@ -11,23 +11,26 @@ const androidConfig = deepmerge.all([commonmobileconfig, {
11
11
  {
12
12
  testObservability: true,
13
13
  buildName: "ANDROID BUILD",
14
- buildIdentifier: "ANDROID BUILD_"+process.env.BUILD_NUMBER ,
14
+ buildIdentifier: "ANDROID BUILD_" + process.env.BUILD_NUMBER,
15
15
  browserstackLocal: false,
16
16
  opts: { forcelocal: false },
17
- app: process.env.BROWSERSTACK_APP_PATH
17
+ app: process.env.BROWSERSTACK_APP_PATH
18
18
  }
19
19
  ]
20
20
  ],
21
21
 
22
22
  capabilities: [{
23
23
  'bstack:options': {
24
- deviceName: process.env.DEVICENAME ,
25
- platformVersion: process.env.OSVERSION ,
24
+ deviceName: process.env.DEVICENAME,
25
+ platformVersion: process.env.OSVERSION,
26
26
  platformName: 'android',
27
27
  interactiveDebugging: true
28
28
  }
29
29
  }],
30
-
30
+ before: function (capabilities, specs) {
31
+ // browser.maximizeWindow()
32
+ process.env.BS_SESSION_TYPE = "app-automate";
33
+ },
31
34
 
32
35
  }]);
33
36
 
@@ -23,13 +23,6 @@ const commonconfig = {
23
23
  //console.log("ALL JSON DATA in env variable :" + JSON.stringify(process.env));
24
24
  },
25
25
 
26
- before: function (capabilities, specs) {
27
-
28
- // Code to run before the test suite starts
29
- console.log('Starting test suite IN EBFORE HOOK ...');
30
- // Initialize variables, configure environment, etc.
31
- },
32
-
33
26
 
34
27
  /**
35
28
  * Gets executed before the suite starts (in Mocha/Jasmine only).
@@ -40,7 +33,7 @@ const commonconfig = {
40
33
  console.log("Running suite:", suite.title);
41
34
  console.log("Reading test data from the API");
42
35
 
43
- getBSSessionDetails("app-automate", process.env.BROWSERSTACK_USERNAME, Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8'));
36
+ getBSSessionDetails( process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8'));
44
37
 
45
38
  } catch (e) {
46
39
  console.log("Error in beforeSuite:", e);
@@ -1,24 +1,27 @@
1
- config = {
1
+ const deepmerge = require('deepmerge')
2
+ const commonconfig = require('./commonconfig');
3
+
4
+ const webbsconfig = deepmerge.all([commonconfig, {
2
5
  // ====================
3
6
  // BrowserStack Configuration
4
7
  // ====================
5
- user: 'prabathkumar_qavxGX',
6
- key: 'RvqEi62rhwa5QwGJtweZ',
7
- browserstackLocal: true, // Set to true if using BrowserStack Local Testing
8
+ user: process.env.BROWSERSTACK_USERNAME || 'prabathkumar_qavxGX',
9
+ key: Buffer.from(process.env.BROWSERSTACK_ACCESS_KEY, 'base64').toString('utf-8') || 'RvqEi62rhwa5QwGJtweZ',
10
+ browserstackLocal: false, // Set to true if using BrowserStack Local Testing
8
11
  opts: { forceLocal: true },
9
12
  // ====================
10
13
  // Specify Test Files
11
14
  // ====================
12
-
15
+
13
16
  services: [
14
17
  ['browserstack', {
15
18
  testObservability: true,
16
19
  testObservabilityOptions: {
17
- user: 'prabathkumar_qavxGX' || process.env.BROWSERSTACK_USERNAME,
18
- key: 'RvqEi62rhwa5QwGJtweZ' || process.env.BROWSERSTACK_ACCESS_KEY,
19
- projectName: 'YTL_AF',
20
- buildName: 'YTL_AF_WEBDRIVERIO',
21
- buildTag: 'YTL_AF_WEBDRIVERIO',
20
+ // user: 'prabathkumar_qavxGX' || process.env.BROWSERSTACK_USERNAME,
21
+ // key: 'RvqEi62rhwa5QwGJtweZ' || process.env.BROWSERSTACK_ACCESS_KEY,
22
+ projectName: process.env.PROJECTNAME || "roboticodigital",
23
+ buildName: 'WEB BUILD',
24
+ buildTag: 'WEB BUILD',
22
25
  },
23
26
  }]
24
27
  ],
@@ -27,8 +30,8 @@ config = {
27
30
  // ====================
28
31
  capabilities: [
29
32
  {
30
- browserName: 'chrome', // Choose the browser you want to test
31
- browserVersion: 'latest', // Specify the browser version
33
+ browserName: process.env.BROWSERSTACK_BROWSER || 'chrome', // Choose the browser you want to test
34
+ browserVersion: process.env.BROWSERSTACK_BROWSER_VERSION || 'latest', // Specify the browser version
32
35
  os: 'Windows', // Specify the operating system
33
36
  os_version: '10', // Specify the operating system version
34
37
  resolution: '1920x1080', // Specify the screen resolution
@@ -52,15 +55,8 @@ config = {
52
55
  // Framework
53
56
  // ====================
54
57
  framework: 'mocha', // Use the Mocha framework
55
- reporters: ['spec',
56
- // [
57
- // 'allure',
58
- // {
59
- // outputDir: './web-report/allure-result/',
60
- // disableWebdriverStepsReporting: true,
61
- // disableWebdriverScreenshotsReporting: false,
62
- // },
63
- // ],
58
+ reporters: ['spec'
59
+
64
60
  ], // Use the spec reporter
65
61
 
66
62
  // ====================
@@ -68,13 +64,14 @@ config = {
68
64
  // ====================
69
65
  before: function (capabilities, specs) {
70
66
  browser.maximizeWindow()
67
+ process.env.BS_SESSION_TYPE="automate";
71
68
  },
72
- after: function (capabilities, specs) {
73
- // Code to run after all tests
74
- if (error) {
75
- browser.takeScreenshot();
76
- }
77
- },
69
+ // after: function (capabilities, specs) {
70
+ // // Code to run after all tests
71
+ // if (error) {
72
+ // browser.takeScreenshot();
73
+ // }
74
+ // },
78
75
 
79
76
  // ====================
80
77
  // BrowserStack Options
@@ -90,6 +87,6 @@ config = {
90
87
  ui: 'bdd', // Set the test interface to BDD
91
88
  timeout: 60000, // Set the timeout for test cases in milliseconds
92
89
  },
93
- };
90
+ }]);
94
91
 
95
- module.exports = config;
92
+ module.exports = webbsconfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",