@browsermation/test 0.0.41 → 0.0.43

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.41",
42261
+ version: "0.0.43",
42262
42262
  description: "The testing platform for Playwright by Browsermation.",
42263
42263
  main: "./dist/index.js",
42264
42264
  types: "./dist/index.d.ts",
@@ -46653,10 +46653,10 @@ async function upload(zipBuffer, shardNumber, totalShards, playwrightConfig, opt
46653
46653
  // src/tunnel.ts
46654
46654
  var import_node_child_process = require("node:child_process");
46655
46655
  function startTunnel(tunnelProcess, options) {
46656
- if (!process.env.TUNNEL_TOKEN) {
46656
+ if (!process.env.BM_TUNNEL_TOKEN) {
46657
46657
  console.error(
46658
46658
  source_default.red.bold(
46659
- "\u274C Error: TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
46659
+ "\u274C Error: BM_TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
46660
46660
  )
46661
46661
  );
46662
46662
  process.exit(1);
@@ -46678,7 +46678,7 @@ function startTunnel(tunnelProcess, options) {
46678
46678
  "--custom_domain",
46679
46679
  tunnelDomain,
46680
46680
  "--token",
46681
- process.env.TUNNEL_TOKEN || ""
46681
+ process.env.BM_TUNNEL_TOKEN || ""
46682
46682
  ]);
46683
46683
  process.on("SIGINT", function() {
46684
46684
  console.log("\nGracefully shutting down from SIGINT (Ctrl+C)");
@@ -46689,7 +46689,9 @@ function startTunnel(tunnelProcess, options) {
46689
46689
  process.exit();
46690
46690
  });
46691
46691
  tunnelProcess?.stdout?.on("data", (data) => {
46692
- console.log(`stdout: ${data}`);
46692
+ if (process.env.BM_DEBUG) {
46693
+ console.log(`stdout: ${data}`);
46694
+ }
46693
46695
  });
46694
46696
  tunnelProcess?.stderr?.on("data", (data) => {
46695
46697
  console.error(`stderr: ${data}`);
@@ -1,2 +1,2 @@
1
1
  import { PlaywrightTestConfig } from 'playwright/test';
2
- export declare function defineConfig<T extends PlaywrightTestConfig>(config: T): Promise<T & PlaywrightTestConfig>;
2
+ export declare function defineConfig<T>(config: PlaywrightTestConfig<T>): Promise<PlaywrightTestConfig<T>>;
package/dist/index.js CHANGED
@@ -537,10 +537,10 @@ var source_default = chalk;
537
537
  // src/tunnel.ts
538
538
  var import_node_child_process = require("node:child_process");
539
539
  function startTunnel(tunnelProcess2, options) {
540
- if (!process.env.TUNNEL_TOKEN) {
540
+ if (!process.env.BM_TUNNEL_TOKEN) {
541
541
  console.error(
542
542
  source_default.red.bold(
543
- "\u274C Error: TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
543
+ "\u274C Error: BM_TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
544
544
  )
545
545
  );
546
546
  process.exit(1);
@@ -562,7 +562,7 @@ function startTunnel(tunnelProcess2, options) {
562
562
  "--custom_domain",
563
563
  tunnelDomain,
564
564
  "--token",
565
- process.env.TUNNEL_TOKEN || ""
565
+ process.env.BM_TUNNEL_TOKEN || ""
566
566
  ]);
567
567
  process.on("SIGINT", function() {
568
568
  console.log("\nGracefully shutting down from SIGINT (Ctrl+C)");
@@ -573,7 +573,9 @@ function startTunnel(tunnelProcess2, options) {
573
573
  process.exit();
574
574
  });
575
575
  tunnelProcess2?.stdout?.on("data", (data) => {
576
- console.log(`stdout: ${data}`);
576
+ if (process.env.BM_DEBUG) {
577
+ console.log(`stdout: ${data}`);
578
+ }
577
579
  });
578
580
  tunnelProcess2?.stderr?.on("data", (data) => {
579
581
  console.error(`stderr: ${data}`);
@@ -620,11 +622,6 @@ async function fetchEndpoint() {
620
622
  if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400) {
621
623
  const redirectUrl = res.headers.location;
622
624
  if (redirectUrl) {
623
- console.log(
624
- source_default.yellow.bold(
625
- `\u{1F500} Redirected to ${redirectUrl}, fetching WebSocket endpoint from there...`
626
- )
627
- );
628
625
  resolve(redirectUrl);
629
626
  }
630
627
  }
@@ -642,15 +639,17 @@ async function defineConfig(config) {
642
639
  `\u2705 WebSocket endpoint fetched successfully: ${endpointUrl}`
643
640
  )
644
641
  );
642
+ let tunnelUrl = void 0;
645
643
  if (config.webServer && (Array.isArray(config.webServer) ? config.webServer.some((server) => server.port) : config.webServer.port)) {
646
- await startTunnel(tunnelProcess, {
644
+ ({ tunnelUrl } = await startTunnel(tunnelProcess, {
647
645
  tunnel: Array.isArray(config.webServer) ? config.webServer.find((server) => server.port)?.port : config.webServer.port
648
- });
646
+ }));
649
647
  }
650
648
  return {
651
649
  ...config,
652
650
  use: {
653
651
  ...config.use,
652
+ baseURL: tunnelUrl,
654
653
  connectOptions: {
655
654
  wsEndpoint: endpointUrl
656
655
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browsermation/test",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "The testing platform for Playwright by Browsermation.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",