chore: roll Playwright to remove empty generic nodes (#330)

This commit is contained in:
Pavel Feldman 2025-05-02 16:10:48 -07:00 committed by GitHub
parent 2c9376e50f
commit 292e75d464
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 41 additions and 48 deletions

28
package-lock.json generated
View File

@ -11,17 +11,17 @@
"dependencies": {
"@modelcontextprotocol/sdk": "^1.10.1",
"commander": "^13.1.0",
"playwright": "1.53.0-alpha-2025-04-25",
"playwright": "1.53.0-alpha-1746218818000",
"yaml": "^2.7.1",
"zod-to-json-schema": "^3.24.4"
},
"bin": {
"mcp-server-playwright": "cli.mjs"
"mcp-server-playwright": "cli.js"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.19.0",
"@playwright/test": "1.53.0-alpha-2025-04-25",
"@playwright/test": "1.53.0-alpha-1746218818000",
"@stylistic/eslint-plugin": "^3.0.1",
"@types/node": "^22.13.10",
"@typescript-eslint/eslint-plugin": "^8.26.1",
@ -287,13 +287,13 @@
}
},
"node_modules/@playwright/test": {
"version": "1.53.0-alpha-2025-04-25",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.0-alpha-2025-04-25.tgz",
"integrity": "sha512-3y4C2ZjAc2oUpwavC2yG2JzH53TOKgcMZvWb5GmpxnOa6fhuSVXK0kIsiIaImKmdffIVM1agsqNHp8yldeBTHQ==",
"version": "1.53.0-alpha-1746218818000",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.0-alpha-1746218818000.tgz",
"integrity": "sha512-J05FD0oOCVbjbp4IjQi5tOPKywchi5EENS9jRjgkA5N9jd/+BaZ3jT8HlLMIgALdk/eLsprQa7vh9h45Q1FOPA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.53.0-alpha-2025-04-25"
"playwright": "1.53.0-alpha-1746218818000"
},
"bin": {
"playwright": "cli.js"
@ -3299,12 +3299,12 @@
}
},
"node_modules/playwright": {
"version": "1.53.0-alpha-2025-04-25",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.0-alpha-2025-04-25.tgz",
"integrity": "sha512-b5VT4lWgyhhy99zHeCoUBt/FQckPxeQVA5ksvxBv0HeqcEvzZzhuyqrrcZewJyflE+5U+bmvqI+yoU0ks8mE3Q==",
"version": "1.53.0-alpha-1746218818000",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.0-alpha-1746218818000.tgz",
"integrity": "sha512-mVIjtdqIawIqWVyvCaLmV6XTALCT4oWWrbMjoHyyWRln3jQjnm3RUO9LkaINz+Yh88O3FkuY6RfjGXPXeFeJ4Q==",
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.53.0-alpha-2025-04-25"
"playwright-core": "1.53.0-alpha-1746218818000"
},
"bin": {
"playwright": "cli.js"
@ -3317,9 +3317,9 @@
}
},
"node_modules/playwright-core": {
"version": "1.53.0-alpha-2025-04-25",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.0-alpha-2025-04-25.tgz",
"integrity": "sha512-gjV01l6A4q/zg+/pwEX50k9lhYWaE9NcDVypSDD331jB3EYrdk0LeDQxqz5XFDOzq/tC/8QTouDs9a/s/p95hA==",
"version": "1.53.0-alpha-1746218818000",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.0-alpha-1746218818000.tgz",
"integrity": "sha512-iaIZmhO/psGssWpxIprJkFrn2h4xFjgL0jZsKGtReAMZ/XhlqMUJxtSitwWM4BV+wxJIptsZD0s5Ml2KU62Z3w==",
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"

View File

@ -37,14 +37,14 @@
"dependencies": {
"@modelcontextprotocol/sdk": "^1.10.1",
"commander": "^13.1.0",
"playwright": "1.53.0-alpha-2025-04-25",
"playwright": "1.53.0-alpha-1746218818000",
"yaml": "^2.7.1",
"zod-to-json-schema": "^3.24.4"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.19.0",
"@playwright/test": "1.53.0-alpha-2025-04-25",
"@playwright/test": "1.53.0-alpha-1746218818000",
"@stylistic/eslint-plugin": "^3.0.1",
"@types/node": "^22.13.10",
"@typescript-eslint/eslint-plugin": "^8.26.1",

View File

@ -24,7 +24,7 @@ export default defineConfig<TestOptions>({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? 'list' : [['list'], ['html']],
reporter: 'list',
projects: [
{ name: 'chrome' },
{ name: 'msedge', use: { mcpBrowser: 'msedge' } },

View File

@ -70,11 +70,8 @@ export async function waitForCompletion<R>(context: Context, page: playwright.Pa
}
}
function sanitize(s: string) {
return s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, '-');
}
export function sanitizeForFilePath(s: string) {
const sanitize = (s: string) => s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, '-');
const separator = s.lastIndexOf('.');
if (separator === -1)
return sanitize(s);

View File

@ -23,7 +23,7 @@ test('cdp server', async ({ cdpEndpoint, startClient }) => {
arguments: {
url: 'data:text/html,<html><title>Title</title><body>Hello, world!</body></html>',
},
})).toContainTextContent(`- text: Hello, world!`);
})).toContainTextContent(`- generic [ref=s1e2]: Hello, world!`);
});
test('cdp server reuse tab', async ({ cdpEndpoint, startClient }) => {
@ -50,7 +50,7 @@ test('cdp server reuse tab', async ({ cdpEndpoint, startClient }) => {
- Page Title:
- Page Snapshot
\`\`\`yaml
- text: hello world
- generic [ref=s1e2]: hello world
\`\`\`
`);
});
@ -70,5 +70,5 @@ test('should throw connection error and allow re-connecting', async ({ cdpEndpoi
arguments: {
url: 'data:text/html,<html><title>Title</title><body>Hello, world!</body></html>',
},
})).toContainTextContent(`- text: Hello, world!`);
})).toContainTextContent(`- generic [ref=s1e2]: Hello, world!`);
});

View File

@ -33,7 +33,7 @@ await page.goto('data:text/html,<html><title>Title</title><body>Hello, world!</b
- Page Title: Title
- Page Snapshot
\`\`\`yaml
- text: Hello, world!
- generic [ref=s1e2]: Hello, world!
\`\`\`
`
);

View File

@ -126,7 +126,7 @@ test('confirm dialog (true)', async ({ client }) => {
expect(result).toContainTextContent('// <internal code to handle "confirm" dialog>');
expect(result).toContainTextContent(`- Page Snapshot
\`\`\`yaml
- text: "true"
- generic [ref=s2e2]: "true"
\`\`\``);
});
@ -156,7 +156,7 @@ test('confirm dialog (false)', async ({ client }) => {
expect(result).toContainTextContent(`- Page Snapshot
\`\`\`yaml
- text: "false"
- generic [ref=s2e2]: "false"
\`\`\``);
});
@ -187,6 +187,6 @@ test('prompt dialog', async ({ client }) => {
expect(result).toContainTextContent(`- Page Snapshot
\`\`\`yaml
- text: Answer
- generic [ref=s2e2]: Answer
\`\`\``);
});

View File

@ -26,9 +26,8 @@ test('browser_file_upload', async ({ client }) => {
},
})).toContainTextContent(`
\`\`\`yaml
- generic [ref=s1e2]:
- button "Choose File" [ref=s1e3]
- button "Button" [ref=s1e4]
- button "Choose File" [ref=s1e3]
- button "Button" [ref=s1e4]
\`\`\``);
{
@ -65,9 +64,8 @@ The tool "browser_file_upload" can only be used when there is related modal stat
expect(response).not.toContainTextContent('### Modal state');
expect(response).toContainTextContent(`
\`\`\`yaml
- generic [ref=s3e2]:
- button "Choose File" [ref=s3e3]
- button "Button" [ref=s3e4]
- button "Choose File" [ref=s3e3]
- button "Button" [ref=s3e4]
\`\`\``);
}

View File

@ -24,14 +24,12 @@ test('stitched aria frames', async ({ client }) => {
},
})).toContainTextContent(`
\`\`\`yaml
- generic [ref=s1e2]:
- heading "Hello" [level=1] [ref=s1e3]
- iframe [ref=s1e4]:
- generic [ref=f1s1e2]:
- button "World" [ref=f1s1e3]
- main [ref=f1s1e4]:
- iframe [ref=f1s1e5]:
- paragraph [ref=f2s1e3]: Nested
- heading "Hello" [level=1] [ref=s1e3]
- iframe [ref=s1e4]:
- button "World" [ref=f1s1e3]
- main [ref=f1s1e4]:
- iframe [ref=f1s1e5]:
- paragraph [ref=f2s1e3]: Nested
\`\`\``);
expect(await client.callTool({

View File

@ -34,7 +34,7 @@ test('test reopen browser', async ({ client }) => {
arguments: {
url: 'data:text/html,<html><title>Title</title><body>Hello, world!</body></html>',
},
})).toContainTextContent(`- text: Hello, world!`);
})).toContainTextContent(`- generic [ref=s1e2]: Hello, world!`);
});
test('executable path', async ({ startClient }) => {

View File

@ -37,7 +37,7 @@ test('save as pdf', async ({ client, mcpBrowser }) => {
arguments: {
url: 'data:text/html,<html><title>Title</title><body>Hello, world!</body></html>',
},
})).toContainTextContent(`- text: Hello, world!`);
})).toContainTextContent(`- generic [ref=s1e2]: Hello, world!`);
const response = await client.callTool({
name: 'browser_pdf_save',

View File

@ -63,7 +63,7 @@ test('create new tab', async ({ client }) => {
- Page Title: Tab one
- Page Snapshot
\`\`\`yaml
- text: Body one
- generic [ref=s1e2]: Body one
\`\`\``);
expect(await createTab(client, 'Tab two', 'Body two')).toHaveTextContent(`
@ -82,7 +82,7 @@ test('create new tab', async ({ client }) => {
- Page Title: Tab two
- Page Snapshot
\`\`\`yaml
- text: Body two
- generic [ref=s1e2]: Body two
\`\`\``);
});
@ -110,7 +110,7 @@ test('select tab', async ({ client }) => {
- Page Title: Tab one
- Page Snapshot
\`\`\`yaml
- text: Body one
- generic [ref=s2e2]: Body one
\`\`\``);
});
@ -137,7 +137,7 @@ test('close tab', async ({ client }) => {
- Page Title: Tab one
- Page Snapshot
\`\`\`yaml
- text: Body one
- generic [ref=s2e2]: Body one
\`\`\``);
});