@browsermation/test 0.0.31 → 0.0.33
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/bin/cli.js +1 -1
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -42258,7 +42258,7 @@ var {
|
|
|
42258
42258
|
// package.json
|
|
42259
42259
|
var package_default = {
|
|
42260
42260
|
name: "@browsermation/test",
|
|
42261
|
-
version: "0.0.
|
|
42261
|
+
version: "0.0.33",
|
|
42262
42262
|
description: "The testing platform for Playwright by Browsermation.",
|
|
42263
42263
|
main: "./dist/index.js",
|
|
42264
42264
|
types: "./dist/index.d.ts",
|
package/dist/index.js
CHANGED
|
@@ -589,6 +589,14 @@ function startTunnel(tunnelProcess2, options) {
|
|
|
589
589
|
|
|
590
590
|
// src/defineConfig.ts
|
|
591
591
|
async function fetchEndpoint() {
|
|
592
|
+
if (!process.env.BM_API_TOKEN) {
|
|
593
|
+
console.error(
|
|
594
|
+
source_default.red.bold(
|
|
595
|
+
"\u274C Error: BM_API_TOKEN environment variable is not set. Please set it to your API token."
|
|
596
|
+
)
|
|
597
|
+
);
|
|
598
|
+
process.exit(1);
|
|
599
|
+
}
|
|
592
600
|
if (!process.env.BM_SERVER_URL) {
|
|
593
601
|
process.env.BM_SERVER_URL = "https://browsermation.test/api/v1/tasks/tests/playwright/ws";
|
|
594
602
|
}
|
|
@@ -599,20 +607,18 @@ async function fetchEndpoint() {
|
|
|
599
607
|
return new Promise((resolve, reject) => {
|
|
600
608
|
const options = {
|
|
601
609
|
headers: {
|
|
602
|
-
Authorization: process.env.BM_API_TOKEN || ""
|
|
610
|
+
Authorization: `Bearer ${process.env.BM_API_TOKEN || ""}`,
|
|
603
611
|
Accept: "application/json"
|
|
604
612
|
}
|
|
605
613
|
};
|
|
606
614
|
protocol.get(process.env.BM_SERVER_URL || "", options, (res) => {
|
|
607
|
-
if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 300)) {
|
|
608
|
-
return reject(new Error(`HTTP status code ${res.statusCode} received`));
|
|
609
|
-
}
|
|
610
615
|
res.on("error", (err) => {
|
|
611
616
|
reject(err);
|
|
612
617
|
});
|
|
613
618
|
res.on("data", async (chunk) => {
|
|
614
619
|
try {
|
|
615
620
|
const parsedData = JSON.parse(chunk.toString());
|
|
621
|
+
console.log("Received data:", parsedData);
|
|
616
622
|
if (parsedData.type === "ws-endpoint") {
|
|
617
623
|
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
618
624
|
resolve(parsedData.wsEndpoint);
|