froth-webdriverio-framework 7.0.2 → 7.0.4
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const axios = require("axios");
|
|
2
2
|
const FormData = require("form-data");
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const amendToBrowserstack = require("../froth_api_calls/browsersatckSessionInfo");
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* ===============================
|
|
@@ -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
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.4",
|
|
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": {
|