playwright 1.56.0-alpha-2025-09-04 → 1.56.0-alpha-2025-09-05

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/lib/program.js CHANGED
@@ -48,6 +48,8 @@ var import_testRunner = require("./runner/testRunner");
48
48
  var import_reporters = require("./runner/reporters");
49
49
  var import_exports = require("./mcp/sdk/exports");
50
50
  var import_testBackend = require("./mcp/test/testBackend");
51
+ var import_program3 = require("./mcp/program");
52
+ const packageJSON = require("../package.json");
51
53
  function addTestCommand(program3) {
52
54
  const command = program3.command("test [test-filter...]");
53
55
  command.description("run tests with Playwright Test");
@@ -141,8 +143,13 @@ Arguments [dir]:
141
143
  Examples:
142
144
  $ npx playwright merge-reports playwright-report`);
143
145
  }
144
- function addMCPServerCommand(program3) {
146
+ function addBrowserMCPServerCommand(program3) {
145
147
  const command = program3.command("run-mcp-server", { hidden: true });
148
+ command.description("Interact with the browser over MCP");
149
+ (0, import_program3.decorateCommand)(command, packageJSON.version);
150
+ }
151
+ function addTestMCPServerCommand(program3) {
152
+ const command = program3.command("run-test-mcp-server", { hidden: true });
146
153
  command.description("Interact with the test runner over MCP");
147
154
  command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
148
155
  command.option("--host <host>", "host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.");
@@ -152,7 +159,7 @@ function addMCPServerCommand(program3) {
152
159
  const backendFactory = {
153
160
  name: "Playwright Test Runner",
154
161
  nameInConfig: "playwright-test-runner",
155
- version: "0.0.0",
162
+ version: packageJSON.version,
156
163
  create: () => new import_testBackend.TestServerBackend(resolvedLocation, { muteConsole: options.port === void 0 })
157
164
  };
158
165
  const mdbUrl = await (0, import_exports.runMainBackend)(backendFactory, { port: options.port === void 0 ? void 0 : +options.port });
@@ -359,7 +366,8 @@ addTestCommand(import_program.program);
359
366
  addShowReportCommand(import_program.program);
360
367
  addMergeReportsCommand(import_program.program);
361
368
  addClearCacheCommand(import_program.program);
362
- addMCPServerCommand(import_program.program);
369
+ addBrowserMCPServerCommand(import_program.program);
370
+ addTestMCPServerCommand(import_program.program);
363
371
  addDevServerCommand(import_program.program);
364
372
  addTestServerCommand(import_program.program);
365
373
  // Annotate the CommonJS export names for ESM import in node: