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/common/expectBundleImpl.js +13 -13
- package/lib/matchers/matcherHint.js +0 -3
- package/lib/matchers/toBeTruthy.js +3 -7
- package/lib/matchers/toEqual.js +5 -5
- package/lib/matchers/toMatchAriaSnapshot.js +5 -8
- package/lib/matchers/toMatchText.js +9 -16
- package/lib/mcp/browser/browserContextFactory.js +28 -21
- package/lib/mcp/browser/codegen.js +5 -3
- package/lib/mcp/browser/config.js +23 -1
- package/lib/mcp/browser/context.js +19 -0
- package/lib/mcp/browser/processUtils.js +87 -0
- package/lib/mcp/browser/response.js +11 -0
- package/lib/mcp/browser/tools/form.js +6 -5
- package/lib/mcp/browser/tools/keyboard.js +5 -15
- package/lib/mcp/browser/tools/snapshot.js +12 -7
- package/lib/mcp/program.js +64 -50
- package/lib/mcpBundleImpl.js +1 -1
- package/lib/program.js +11 -3
- package/lib/transform/babelBundleImpl.js +10 -10
- package/lib/utilsBundleImpl.js +1 -1
- package/lib/worker/fixtureRunner.js +13 -7
- package/package.json +2 -2
- package/types/test.d.ts +4 -4
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
|
|
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:
|
|
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
|
-
|
|
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:
|