@browsermation/test 0.0.46 → 0.0.49
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 +15 -7
- 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.49",
|
|
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
|
@@ -634,31 +634,39 @@ process.on("exit", () => {
|
|
|
634
634
|
});
|
|
635
635
|
async function defineConfig(config) {
|
|
636
636
|
const endpointUrl = await fetchEndpoint();
|
|
637
|
+
if (!endpointUrl) {
|
|
638
|
+
console.error(
|
|
639
|
+
source_default.red.bold(
|
|
640
|
+
"\u274C Error: Failed to fetch WebSocket endpoint. Please check your BM_API_TOKEN and network connection."
|
|
641
|
+
)
|
|
642
|
+
);
|
|
643
|
+
process.exit(1);
|
|
644
|
+
}
|
|
637
645
|
console.log(
|
|
638
646
|
source_default.green.bold(
|
|
639
647
|
`\u2705 WebSocket endpoint fetched successfully: ${endpointUrl}`
|
|
640
648
|
)
|
|
641
649
|
);
|
|
642
650
|
let tunnelUrl = void 0;
|
|
643
|
-
if (config.webServer && (Array.isArray(config.webServer) ? config.webServer.some((server) => server.port) : config.webServer.port)) {
|
|
651
|
+
if (config.webServer && (Array.isArray(config.webServer) ? config.webServer.some((server) => server.port) : config.webServer.port) || process.env.BM_TUNNEL_PORT) {
|
|
652
|
+
const port = (Array.isArray(config.webServer) ? config.webServer.find((server) => server.port)?.port : config.webServer.port) || process.env.BM_TUNNEL_PORT;
|
|
644
653
|
({ tunnelUrl } = await startTunnel(tunnelProcess, {
|
|
645
|
-
tunnel:
|
|
654
|
+
tunnel: port
|
|
646
655
|
}));
|
|
647
656
|
}
|
|
648
657
|
const bmConfig = {
|
|
649
658
|
...config,
|
|
650
|
-
webServer: {
|
|
651
|
-
...config.webServer,
|
|
652
|
-
url: tunnelUrl
|
|
653
|
-
},
|
|
654
659
|
use: {
|
|
655
660
|
...config.use,
|
|
656
|
-
baseURL: tunnelUrl,
|
|
657
661
|
connectOptions: {
|
|
658
662
|
wsEndpoint: endpointUrl
|
|
659
663
|
}
|
|
660
664
|
}
|
|
661
665
|
};
|
|
666
|
+
if (tunnelUrl) {
|
|
667
|
+
bmConfig.use.baseURL = tunnelUrl;
|
|
668
|
+
console.log(source_default.green.bold(`\u2705 Tunnel URL: ${tunnelUrl}`));
|
|
669
|
+
}
|
|
662
670
|
if (process.env.BM_DEBUG) {
|
|
663
671
|
console.log(source_default.yellow.bold("\u{1F527} BM_DEBUG is enabled. Configuration:"));
|
|
664
672
|
console.dir(bmConfig, { depth: null });
|