@browsermation/test 0.0.65 → 0.0.66
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.
- package/dist/reporter.js +15 -9
- package/package.json +1 -1
package/dist/reporter.js
CHANGED
|
@@ -159,21 +159,27 @@ var BrowsermationReporter = class {
|
|
|
159
159
|
);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
+
if (process.env.BM_BROWSER_RUN_ID) {
|
|
163
|
+
data.browser_run_id = process.env.BM_BROWSER_RUN_ID;
|
|
164
|
+
}
|
|
162
165
|
if (!this.apiToken) {
|
|
163
166
|
this.log("API token not set. Skipping sending data to Browsermation.");
|
|
164
167
|
return;
|
|
165
168
|
}
|
|
166
169
|
this.log(`Sending data to Browsermation: ${JSON.stringify(data)}`);
|
|
167
170
|
try {
|
|
168
|
-
const response = await fetch(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
const response = await fetch(
|
|
172
|
+
`${this.browsermationURL}?type=${data.type}`,
|
|
173
|
+
{
|
|
174
|
+
method: "POST",
|
|
175
|
+
headers: {
|
|
176
|
+
Accept: "application/json",
|
|
177
|
+
"Content-Type": "application/json",
|
|
178
|
+
Authorization: `Bearer ${this.apiToken}`
|
|
179
|
+
},
|
|
180
|
+
body: JSON.stringify(data)
|
|
181
|
+
}
|
|
182
|
+
);
|
|
177
183
|
if (!response.ok) {
|
|
178
184
|
this.log(
|
|
179
185
|
`Failed to send data to Browsermation. Status: ${response.status} - ${response.statusText}`
|