chore: roll Playwright to 1.59.0-alpha-1773608981000 (#1461)

## Summary
- Roll playwright and playwright-core to `1.59.0-alpha-1773451864000`
- Fix `install-browser` CLI command registration (was calling
`parseAsync` before registering the subcommand)
- Add `selector` parameter to accessibility snapshot documentation
- Add CLAUDE.md
This commit is contained in:
Pavel Feldman
2026-03-16 09:40:52 -07:00
committed by GitHub
parent a6baddb044
commit 4c6d66d04e
12 changed files with 122 additions and 60 deletions

View File

@@ -16,9 +16,17 @@
*/
const { program } = require('playwright-core/lib/utilsBundle');
const { decorateMCPCommand } = require('playwright/lib/mcp/program');
const { decorateMCPCommand } = require('playwright-core/lib/tools/mcp/program');
if (process.argv.includes('install-browser')) {
const argv = process.argv.map(arg => arg === 'install-browser' ? 'install' : arg);
const { program: mainProgram } = require('playwright-core/lib/cli/program');
mainProgram.parse(argv);
return;
}
const packageJSON = require('./package.json');
const p = program.version('Version ' + packageJSON.version).name('Playwright MCP');
decorateMCPCommand(p, packageJSON.version)
void program.parseAsync(process.argv);

View File

@@ -137,19 +137,6 @@ export type Config = {
*/
saveSession?: boolean;
/**
* Whether to save the Playwright trace of the session into the output directory.
*/
saveTrace?: boolean;
/**
* If specified, saves the Playwright video of the session into the output directory.
*/
saveVideo?: {
width: number;
height: number;
};
/**
* Reuse the same browser context between all connected HTTP clients.
*/
@@ -214,6 +201,11 @@ export type Config = {
* Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.
*/
navigation?: number;
/**
* Configures default expect timeout: https://playwright.dev/docs/test-timeouts#expect-timeout. Defaults to 5000ms.
*/
expect?: number;
};
/**

View File

@@ -15,5 +15,5 @@
* limitations under the License.
*/
const { createConnection } = require('playwright/lib/mcp/index');
const { createConnection } = require('playwright-core/lib/tools/exports');
module.exports = { createConnection };

View File

@@ -33,8 +33,8 @@
}
},
"dependencies": {
"playwright": "1.59.0-alpha-1771104257000",
"playwright-core": "1.59.0-alpha-1771104257000"
"playwright": "1.59.0-alpha-1773608981000",
"playwright-core": "1.59.0-alpha-1773608981000"
},
"bin": {
"playwright-mcp": "cli.js"

View File

@@ -30,7 +30,6 @@ test('test snapshot tool list', async ({ client }) => {
'browser_select_option',
'browser_type',
'browser_close',
'browser_install',
'browser_navigate_back',
'browser_navigate',
'browser_network_requests',

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import child_process from 'child_process';
import path from 'path';
import { test, expect } from './fixtures';
const cliPath = path.resolve(__dirname, '..', 'cli.js');
test('install-browser --help', async () => {
const output = child_process.execSync(`node ${cliPath} install-browser --help`, { encoding: 'utf-8' });
expect(output).toContain('install');
});

View File

@@ -20,7 +20,7 @@ const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process');
const { browserTools } = require('playwright/lib/mcp/browser/tools');
const { browserTools } = require('playwright-core/lib/tools/exports');
const capabilities = /** @type {Record<string, string>} */ ({
'core-navigation': 'Core automation',