froth-webdriverio-framework 3.0.53 → 3.0.55

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.
@@ -98,6 +98,16 @@ async function getBSSessionDetails(sessiontype, bs_username, bs_pwd) {
98
98
 
99
99
  }
100
100
 
101
+ async function amend2Browserstack(annotationMessage, level) {
102
+ try {
103
+ await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"' + annotationMessage + '","level": "' + level + '"}}');
104
+
105
+ } catch (error) {
106
+ console.error('Error occurred while annoting to BS :', error);
107
+ throw error;
108
+ }
109
+ }
110
+
101
111
  //Execute the main function
102
112
 
103
113
  //Main function to execute the API call
@@ -111,5 +121,8 @@ async function getBSSessionDetails(sessiontype, bs_username, bs_pwd) {
111
121
  // }
112
122
 
113
123
  // main();
114
- module.exports = getBSSessionDetails;
124
+ module.exports = {getBSSessionDetails,
125
+ getBSBuildDetails,
126
+ amend2Browserstack
127
+ };
115
128
 
@@ -1,3 +1,4 @@
1
+ const amendToBrowserstack = require("../api/browsersatckSessionInfo").amend2Browserstack;
1
2
 
2
3
  async function callapi(method, api_url, queryParams, payloaddetails, authentication, headers, attachments) {
3
4
  let response;
@@ -34,6 +35,9 @@ async function callapi(method, api_url, queryParams, payloaddetails, authenticat
34
35
  }
35
36
  catch (error) {
36
37
  console.error('Error during API call in call api menthod:', error);
38
+ let annotationMessage = 'Error during API call:'+ error.response ? error.response.data : error.message;
39
+ if (process.env.BROWSERSTACK)
40
+ await amendToBrowserstack(annotationMessage, "error");
37
41
  }
38
42
  return response;
39
43
  }
@@ -72,6 +76,8 @@ async function formheaders(authentication, headers) {
72
76
  } catch (e) {
73
77
 
74
78
  console.error('Error in formheaders:', e);
79
+ let annotationMessage = 'Error during API call:'+ error.response ? error.response.data : error.message;
80
+
75
81
  }
76
82
  return headers;
77
83
 
@@ -89,6 +95,7 @@ async function validate(attribute_name, attribute, actionname, buffer, buffernam
89
95
  }
90
96
  } catch (e) {
91
97
  console.error('Error in validate method:', e);
98
+
92
99
  }
93
100
  }
94
101
 
@@ -124,13 +131,13 @@ async function validateAttributeData(attribute_name,attribute,buffer, buffername
124
131
  await amendToBrowserstack(annotationMessage, "error");
125
132
  }
126
133
  }
127
- async function amendToBrowserstack(annotationMessage, level) {
128
- try {
129
- await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"' + annotationMessage + '","level": "' + level + '"}}');
130
-
131
- } catch (error) {
132
- console.error('Error occurred while annoting to BS :', error);
133
- throw error;
134
- }
135
- }
134
+ // async function amendToBrowserstack(annotationMessage, level) {
135
+ // try {
136
+ // await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"' + annotationMessage + '","level": "' + level + '"}}');
137
+
138
+ // } catch (error) {
139
+ // console.error('Error occurred while annoting to BS :', error);
140
+ // throw error;
141
+ // }
142
+ // }
136
143
  module.exports = { callapi, validate };
@@ -3,7 +3,7 @@ const { LocalStorage } = require('node-localstorage');
3
3
  global.BUFFER = new LocalStorage('./storage');
4
4
  const path = require('path');
5
5
  const exeDetails = require("../api/getexecutionDetails")
6
- const getBSSessionDetails = require("../api/browsersatckSessionInfo");
6
+ const getBSSessionDetails = require("../api/browsersatckSessionInfo").getBSSessionDetails;
7
7
  const { fail } = require("assert");
8
8
  const isBrowserStackEnabled = process.env.BROWSERSTACK;
9
9
  let starttime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.53",
3
+ "version": "3.0.55",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",