froth-webdriverio-framework 7.0.3 → 7.0.5

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.
@@ -77,17 +77,17 @@ async function getBSSessionDetails(sessionType, bsUsername, bsPassword) {
77
77
  }
78
78
  }
79
79
 
80
- async function amend2Browserstack(annotationMessage, level) {
81
- try {
82
- console.log(`Annotation message: ${annotationMessage}`);
83
- if (process.env.PLATFORM === 'browserstack') {
84
- await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "${level}"}}`);
85
- }
86
- } catch (error) {
87
- console.error('Error annotating BrowserStack session:', error);
88
- throw error;
89
- }
90
- }
80
+ // async function amend2Browserstack(annotationMessage, level) {
81
+ // try {
82
+ // console.log(`Annotation message: ${annotationMessage}`);
83
+ // if (process.env.PLATFORM === 'browserstack') {
84
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "${level}"}}`);
85
+ // }
86
+ // } catch (error) {
87
+ // console.error('Error annotating BrowserStack session:', error);
88
+ // throw error;
89
+ // }
90
+ // }
91
91
  async function amend2Browserstack(annotationMessage, level) {
92
92
  try {
93
93
  const MAX_CHUNK_SIZE = 800 * 1024; // 800 KB
@@ -109,8 +109,15 @@ async function amend2Browserstack(annotationMessage, level) {
109
109
 
110
110
  console.log(`Annotation message: ${chunkMessage}`);
111
111
 
112
+ // await driver.execute("browserstack_executor", {
113
+ // action: "annotate",
114
+ // arguments: {
115
+ // data: chunkMessage,
116
+ // level: level
117
+ // }
118
+ // });
112
119
  if (process.env.PLATFORM === 'browserstack' || process.env.PLATFORM === 'browserstacklocal') {
113
- await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${chunkMessage}","level": "${level}"}}`);
120
+ await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${JSON.stringify(chunkMessage)}","level": "${level}"}}`);
114
121
  }
115
122
  }
116
123
 
@@ -51,7 +51,7 @@ async function callapi(
51
51
  * -------- ANNOTATE REQUEST --------
52
52
  * Full request annotated with chunking handled in amend2Browserstack
53
53
  */
54
- await amendToBrowserstack(
54
+ await amendToBrowserstack.amend2Browserstack(
55
55
  safeStringify({
56
56
  method,
57
57
  url: apiUrl,
@@ -79,7 +79,7 @@ async function callapi(
79
79
  * -------- ANNOTATE FULL RESPONSE --------
80
80
  * Now chunking is handled in amend2Browserstack
81
81
  */
82
- await amendToBrowserstack(
82
+ await amendToBrowserstack.amend2Browserstack(
83
83
  safeStringify({
84
84
  status: response.status,
85
85
  durationMs: duration,
@@ -89,7 +89,7 @@ async function callapi(
89
89
  );
90
90
 
91
91
  } catch (error) {
92
- await amendToBrowserstack(
92
+ await amendToBrowserstack.amend2Browserstack(
93
93
  safeStringify({
94
94
  message: error.message,
95
95
  status: error.response?.status,
@@ -178,14 +178,14 @@ async function validate(
178
178
 
179
179
  case "setbuffer":
180
180
  BUFFER.setItem(bufferKey, actualValue);
181
- await amendToBrowserstack(
181
+ await amendToBrowserstack.amend2Browserstack(
182
182
  `Stored value in BUFFER: ${bufferKey}`,
183
183
  "info"
184
184
  );
185
185
  break;
186
186
 
187
187
  case "getbuffer":
188
- await amendToBrowserstack(
188
+ await amendToBrowserstack.amend2Browserstack(
189
189
  `Retrieved value from BUFFER: ${bufferKey}`,
190
190
  "info"
191
191
  );
@@ -221,12 +221,12 @@ async function validateAttributeData(
221
221
 
222
222
  try {
223
223
  expect(actualValue).toBe(expectedValue);
224
- await amendToBrowserstack(
224
+ await amendToBrowserstack.amend2Browserstack(
225
225
  `${attributeName} verification passed`,
226
226
  "info"
227
227
  );
228
228
  } catch (e) {
229
- await amendToBrowserstack(
229
+ await amendToBrowserstack.amend2Browserstack(
230
230
  `${attributeName} verification failed`,
231
231
  "error"
232
232
  );
@@ -159,9 +159,9 @@ const commonHooks = {
159
159
  capabilities['bstack:options'] = bsOpts;
160
160
 
161
161
  }
162
- console.log('final cinfig dteials :' + JSON.stringify(capabilities))
162
+ //console.log('final cinfig dteials :' + JSON.stringify(capabilities))
163
163
 
164
- console.log("config details " + JSON.stringify(config))
164
+ // console.log("config details " + JSON.stringify(config))
165
165
 
166
166
 
167
167
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "7.0.3",
3
+ "version": "7.0.5",
4
4
  "readme": "WendriverIO Integration with [BrowserStack](https://www.browserstack.com)",
5
5
  "description": "Selenium examples for WebdriverIO and BrowserStack App Automate",
6
6
  "scripts": {