@browsermation/test 0.0.47 → 0.0.50

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 CHANGED
@@ -42258,7 +42258,7 @@ var {
42258
42258
  // package.json
42259
42259
  var package_default = {
42260
42260
  name: "@browsermation/test",
42261
- version: "0.0.47",
42261
+ version: "0.0.50",
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,27 +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 (process.env.BM_TUNNEL_PORT || config.webServer && (Array.isArray(config.webServer) ? config.webServer.some((server) => server?.port) : config.webServer?.port)) {
652
+ const port = process.env.BM_TUNNEL_PORT || (Array.isArray(config.webServer) ? config.webServer.find((server) => server?.port)?.port : config?.webServer?.port);
644
653
  ({ tunnelUrl } = await startTunnel(tunnelProcess, {
645
- tunnel: Array.isArray(config.webServer) ? config.webServer.find((server) => server.port)?.port : config.webServer.port
654
+ tunnel: port
646
655
  }));
647
656
  }
648
657
  const bmConfig = {
649
658
  ...config,
650
659
  use: {
651
660
  ...config.use,
652
- baseURL: tunnelUrl,
653
661
  connectOptions: {
654
662
  wsEndpoint: endpointUrl
655
663
  }
656
664
  }
657
665
  };
666
+ if (tunnelUrl) {
667
+ bmConfig.use.baseURL = tunnelUrl;
668
+ console.log(source_default.green.bold(`\u2705 Tunnel URL: ${tunnelUrl}`));
669
+ }
658
670
  if (process.env.BM_DEBUG) {
659
671
  console.log(source_default.yellow.bold("\u{1F527} BM_DEBUG is enabled. Configuration:"));
660
672
  console.dir(bmConfig, { depth: null });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browsermation/test",
3
- "version": "0.0.47",
3
+ "version": "0.0.50",
4
4
  "description": "The testing platform for Playwright by Browsermation.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",