froth-webdriverio-framework 1.0.39 → 1.0.41

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 {
@@ -38,8 +38,8 @@ async function getExecuitonDetails(frothUrl, token, id) {
38
38
  return getExecuitonDetails(frothUrl, newToken, id);
39
39
  } else {
40
40
  const errorText = await response.text();
41
- console.error('Data fetch failed response:', errorText);
42
- throw new Error(`HTTP error! status: ${response.status}`);
41
+ console.error(`Data fetch failed response: ${response.status}`);
42
+ // throw new Error(`HTTP error! status: ${response.status}`);
43
43
  }
44
44
 
45
45
 
@@ -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 {
@@ -34,8 +34,8 @@ async function getSuiteDetails(frothUrl, token, id) {
34
34
  }
35
35
  else {
36
36
  const errorText = await response.text();
37
- console.error('Data fetch failed response:', errorText);
38
- throw new Error(`HTTP error! status: ${response.status}`);
37
+ console.error(`Data fetch failed response: ${response.status}`);
38
+ // throw new Error(`HTTP error! status: ${response.status}`);
39
39
  }
40
40
 
41
41
 
@@ -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 {
@@ -41,8 +41,9 @@ async function getDataById(frothUrl, token, id) {
41
41
  }
42
42
  else {
43
43
  const errorText = await response.text();
44
- console.error('Data fetch failed response:', errorText);
45
- throw new Error(`HTTP error! status: ${response.status}`);
44
+ // console.error('Data fetch failed response:', errorText);
45
+ console.error(`Data fetch failed response: ${response.status}`);
46
+ // throw new Error(`HTTP error! status: ${response.status}`);
46
47
  }
47
48
 
48
49
 
@@ -52,7 +53,7 @@ async function getDataById(frothUrl, token, id) {
52
53
 
53
54
  }
54
55
  } else {
55
- console.error('Error fetching data: Invalid ID');
56
+ console.error('Error fetching data: Invalid ID or no testdata linked to the execution.');
56
57
  }
57
58
 
58
59
  }
@@ -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,14 +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
- // browser.maximizeWindow();
31
- // // Initialize variables, configure environment, etc.
32
- // },
33
-
34
26
 
35
27
  /**
36
28
  * Gets executed before the suite starts (in Mocha/Jasmine only).
@@ -41,7 +33,7 @@ const commonconfig = {
41
33
  console.log("Running suite:", suite.title);
42
34
  console.log("Reading test data from the API");
43
35
 
44
- 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'));
45
37
 
46
38
  } catch (e) {
47
39
  console.log("Error in beforeSuite:", e);
@@ -10,9 +10,10 @@ const iosconfig = deepmerge.all([commonmobileconfig, {
10
10
  buildName: "IOS",
11
11
  buildIdentifier: 'BUILD',
12
12
  browserstackLocal: false,
13
- opts: {
14
- forcelocal: false,
15
- localIdentifier: "webdriverio-appium" },
13
+ opts: {
14
+ forcelocal: false,
15
+ localIdentifier: "webdriverio-appium"
16
+ },
16
17
  app: process.env.BROWSERSTACK_APP_PATH || 'bs://d6588d0899a2ac5c485d4784af9ad28d06b98c44'
17
18
  }
18
19
  ]
@@ -22,10 +23,15 @@ const iosconfig = deepmerge.all([commonmobileconfig, {
22
23
  'bstack:options': {
23
24
  deviceName: process.env.DEVICENAME || "iPhone 15 Pro Max1",
24
25
  osVersion: process.env.OSVERSION || "17",
26
+ platformName: 'iOS',
25
27
  interactiveDebugging: true
26
28
  }
27
29
  }],
28
30
 
31
+ before: function (capabilities, specs) {
32
+ // browser.maximizeWindow()
33
+ process.env.BS_SESSION_TYPE = "app-automate";
34
+ },
29
35
  }]);
30
36
 
31
37
  module.exports = iosconfig;
@@ -64,13 +64,9 @@ const webbsconfig = deepmerge.all([commonconfig, {
64
64
  // ====================
65
65
  before: function (capabilities, specs) {
66
66
  browser.maximizeWindow()
67
+ process.env.BS_SESSION_TYPE="automate";
67
68
  },
68
- // after: function (capabilities, specs) {
69
- // // Code to run after all tests
70
- // if (error) {
71
- // browser.takeScreenshot();
72
- // }
73
- // },
69
+
74
70
 
75
71
  // ====================
76
72
  // BrowserStack Options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",