From f7e9bae571a12ea6d08a167e57c026f4d90f703f Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 22 Apr 2025 16:04:50 -0700 Subject: [PATCH] chore: roll playwright to 1745357020000 (#249) --- package-lock.json | 26 +++++++++++++------------- package.json | 4 ++-- src/context.ts | 2 +- tests/core.spec.ts | 4 ++-- tests/files.spec.ts | 14 ++++++++++++-- tests/iframes.spec.ts | 14 ++++++++------ 6 files changed, 38 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index e552382..3cbfc82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@modelcontextprotocol/sdk": "^1.6.1", "commander": "^13.1.0", - "playwright": "^1.52.0-alpha-1743163434000", + "playwright": "1.53.0-alpha-1745357020000", "yaml": "^2.7.1", "zod-to-json-schema": "^3.24.4" }, @@ -21,7 +21,7 @@ "devDependencies": { "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.19.0", - "@playwright/test": "^1.52.0-alpha-1743163434000", + "@playwright/test": "1.53.0-alpha-1745357020000", "@stylistic/eslint-plugin": "^3.0.1", "@types/node": "^22.13.10", "@typescript-eslint/eslint-plugin": "^8.26.1", @@ -286,13 +286,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.52.0-alpha-1743163434000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.52.0-alpha-1743163434000.tgz", - "integrity": "sha512-4uBgNlJ6hgPtB8DrwQsgoKuVoe7j+nPqudna7CLXWCmmT3LYPMD5aOjGoBkszr+R9NejtKashq/bOi/ny9hsIA==", + "version": "1.53.0-alpha-1745357020000", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.0-alpha-1745357020000.tgz", + "integrity": "sha512-7xQRHhsS//elVJVt2WybJPXAy++WiE8yJzMtVFcnzdQNg9VNSbpqo4b61io5IIG1nEfB22N4BhjQ/8jPrUyu9A==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.52.0-alpha-1743163434000" + "playwright": "1.53.0-alpha-1745357020000" }, "bin": { "playwright": "cli.js" @@ -3301,12 +3301,12 @@ } }, "node_modules/playwright": { - "version": "1.52.0-alpha-1743163434000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.52.0-alpha-1743163434000.tgz", - "integrity": "sha512-4uYv49ekPjolydfFfTfFQ2z4URF9UZMVUXLy7aXam/tPxEQ5O7+jQC+yzrDMGmhcj5QkMnxjlyk7N2V9a0QLdQ==", + "version": "1.53.0-alpha-1745357020000", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.0-alpha-1745357020000.tgz", + "integrity": "sha512-evnZJIB1CRSA1HfwCkLhyqyGZybSWdNwfyyUWhBoez9ISbYMuYrTtidx75oiGVXtbKr5s8iC0+opuvagu4L1vA==", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-alpha-1743163434000" + "playwright-core": "1.53.0-alpha-1745357020000" }, "bin": { "playwright": "cli.js" @@ -3319,9 +3319,9 @@ } }, "node_modules/playwright-core": { - "version": "1.52.0-alpha-1743163434000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.52.0-alpha-1743163434000.tgz", - "integrity": "sha512-Tn4u3Ywwjkh847/bYWlXIrNxv5DRJRDgtb+VYMXHvNCKkrxL6yfZ1ApIAYD7IAkkKH/KLTXszGWl3a/Z/KDfQA==", + "version": "1.53.0-alpha-1745357020000", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.0-alpha-1745357020000.tgz", + "integrity": "sha512-3oPzOUwJ/yhNWUs3fh5UbmI1Mf18sHUDo3gxzuPwqxN3QCSFKx9Ncg7cSB+FyJCkgz7ZD8fUlzJ75YsDE+PMfA==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 2748e56..8b43be4 100644 --- a/package.json +++ b/package.json @@ -36,14 +36,14 @@ "dependencies": { "@modelcontextprotocol/sdk": "^1.6.1", "commander": "^13.1.0", - "playwright": "^1.52.0-alpha-1743163434000", + "playwright": "1.53.0-alpha-1745357020000", "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.52.0-alpha-1743163434000", + "@playwright/test": "1.53.0-alpha-1745357020000", "@stylistic/eslint-plugin": "^3.0.1", "@types/node": "^22.13.10", "@typescript-eslint/eslint-plugin": "^8.26.1", diff --git a/src/context.ts b/src/context.ts index cb059e2..25fe8a8 100644 --- a/src/context.ts +++ b/src/context.ts @@ -413,7 +413,7 @@ class PageSnapshot { private async _snapshotFrame(frame: playwright.Page | playwright.FrameLocator) { const frameIndex = this._frameLocators.push(frame) - 1; - const snapshotString = await frame.locator('body').ariaSnapshot({ ref: true }); + const snapshotString = await frame.locator('body').ariaSnapshot({ ref: true, emitGeneric: true }); const snapshot = yaml.parseDocument(snapshotString); const visit = async (node: any): Promise => { diff --git a/tests/core.spec.ts b/tests/core.spec.ts index ff415ee..44ab50f 100644 --- a/tests/core.spec.ts +++ b/tests/core.spec.ts @@ -96,8 +96,8 @@ await page.getByRole('combobox').selectOption(['bar']); - Page Snapshot \`\`\`yaml - combobox [ref=s2e3]: - - option "Foo" [ref=s2e4] - - option "Bar" [selected] [ref=s2e5] + - option "Foo" + - option "Bar" [selected] \`\`\` `); }); diff --git a/tests/files.spec.ts b/tests/files.spec.ts index b7a16b1..6e9b797 100644 --- a/tests/files.spec.ts +++ b/tests/files.spec.ts @@ -23,7 +23,12 @@ test('browser_file_upload', async ({ client }) => { arguments: { url: 'data:text/html,Title', }, - })).toContainTextContent('- textbox [ref=s1e3]'); + })).toContainTextContent(` +\`\`\`yaml +- generic [ref=s1e2]: + - button "Choose File" [ref=s1e3] + - button "Button" [ref=s1e4] +\`\`\``); expect(await client.callTool({ name: 'browser_click', @@ -46,7 +51,12 @@ test('browser_file_upload', async ({ client }) => { }); expect(response).not.toContainTextContent('### Modal state'); - expect(response).toContainTextContent('textbox [ref=s3e3]: C:\\fakepath\\test.txt'); + expect(response).toContainTextContent(` +\`\`\`yaml +- generic [ref=s3e2]: + - button "Choose File" [ref=s3e3] + - button "Button" [ref=s3e4] +\`\`\``); } { diff --git a/tests/iframes.spec.ts b/tests/iframes.spec.ts index 6133c39..3b55f1b 100644 --- a/tests/iframes.spec.ts +++ b/tests/iframes.spec.ts @@ -24,12 +24,14 @@ test('stitched aria frames', async ({ client }) => { }, })).toContainTextContent(` \`\`\`yaml -- heading "Hello" [level=1] [ref=s1e3] -- iframe [ref=s1e4]: - - button "World" [ref=f1s1e3] - - main [ref=f1s1e4]: - - iframe [ref=f1s1e5]: - - paragraph [ref=f2s1e3]: Nested +- 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 \`\`\``); expect(await client.callTool({