From 941dc911976de5a0af4de77a4b9b3f2e7c175adb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:41:13 +0000 Subject: [PATCH 1/5] chore(deps-dev): bump the bundled group with 2 updates Bumps the bundled group with 2 updates: [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) and [puppeteer](https://github.com/puppeteer/puppeteer). Updates `@modelcontextprotocol/sdk` from 1.20.1 to 1.20.2 - [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases) - [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/1.20.1...1.20.2) Updates `puppeteer` from 24.26.0 to 24.26.1 - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.26.0...puppeteer-v24.26.1) --- updated-dependencies: - dependency-name: "@modelcontextprotocol/sdk" dependency-version: 1.20.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: bundled - dependency-name: puppeteer dependency-version: 24.26.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: bundled ... Signed-off-by: dependabot[bot] --- package-lock.json | 36 ++++++++++++++++++------------------ package.json | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1017ebb85..36a0c2b4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@eslint/js": "^9.35.0", - "@modelcontextprotocol/sdk": "1.20.1", + "@modelcontextprotocol/sdk": "1.20.2", "@rollup/plugin-commonjs": "^28.0.8", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", @@ -33,7 +33,7 @@ "eslint-plugin-import": "^2.32.0", "globals": "^16.4.0", "prettier": "^3.6.2", - "puppeteer": "24.26.0", + "puppeteer": "24.26.1", "rollup": "4.52.5", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-license": "^3.6.0", @@ -380,9 +380,9 @@ "license": "MIT" }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.20.1.tgz", - "integrity": "sha512-j/P+yuxXfgxb+mW7OEoRCM3G47zCTDqUPivJo/VzpjbG8I9csTXtOprCf5FfOfHK4whOJny0aHuBEON+kS7CCA==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.20.2.tgz", + "integrity": "sha512-6rqTdFt67AAAzln3NOKsXRmv5ZzPkgbfaebKBqUbts7vK1GZudqnrun5a8d3M/h955cam9RHZ6Jb4Y1XhnmFPg==", "dev": true, "license": "MIT", "dependencies": { @@ -1976,9 +1976,9 @@ "license": "MIT" }, "node_modules/bare-events": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.0.tgz", - "integrity": "sha512-AOhh6Bg5QmFIXdViHbMc2tLDsBIRxdkIaIddPslJF9Z5De3APBScuqGP2uThXnIpqFrgoxMNC6km7uXNIMLHXA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.1.tgz", + "integrity": "sha512-oxSAxTS1hRfnyit2CL5QpAOS5ixfBjj6ex3yTNvXyY/kE719jQ/IjuESJBK2w5v4wwQRAHGseVJXx9QBYOtFGQ==", "dev": true, "license": "Apache-2.0", "peerDependencies": { @@ -1991,9 +1991,9 @@ } }, "node_modules/bare-fs": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.4.11.tgz", - "integrity": "sha512-Bejmm9zRMvMTRoHS+2adgmXw1ANZnCNx+B5dgZpGwlP1E3x6Yuxea8RToddHUbWtVV0iUMWqsgZr8+jcgUI2SA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.0.tgz", + "integrity": "sha512-GljgCjeupKZJNetTqxKaQArLK10vpmK28or0+RwWjEl5Rk+/xG3wkpmkv+WrcBm3q1BwHKlnhXzR8O37kcvkXQ==", "dev": true, "license": "Apache-2.0", "optional": true, @@ -5380,9 +5380,9 @@ } }, "node_modules/puppeteer": { - "version": "24.26.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.26.0.tgz", - "integrity": "sha512-5F4A3dGeuw0jJOR3hGV969TO8oi+JG2TzqxAFvH+gxzxh0ILZmiFskWPlhcWQh5s9HAtgZyktOBDqs6zOi7IKA==", + "version": "24.26.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.26.1.tgz", + "integrity": "sha512-3RG2UqclzMFolM2fS4bN8t5/EjZ0VwEoAGVxG8PMGeprjLzj+x0U4auH7MQ4B6ftW+u1JUnTTN8ab4ABPdl4mA==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -5391,7 +5391,7 @@ "chromium-bidi": "10.5.1", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1508733", - "puppeteer-core": "24.26.0", + "puppeteer-core": "24.26.1", "typed-query-selector": "^2.12.0" }, "bin": { @@ -5402,9 +5402,9 @@ } }, "node_modules/puppeteer-core": { - "version": "24.26.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.26.0.tgz", - "integrity": "sha512-l3aMYhTdSzazZ14rfpNAPGhnYHsd8mwduqybhu5aO/OR+d24P/V/eo8XTB3GB2yX2ZWf9GLAVcx8nnVPFZpP/A==", + "version": "24.26.1", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.26.1.tgz", + "integrity": "sha512-YHZdo3chJ5b9pTYVnuDuoI3UX/tWJFJyRZvkLbThGy6XeHWC+0KI8iN0UMCkvde5l/YOk3huiVZ/PvwgSbwdrA==", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 0fdb3a90e..9689137aa 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "mcpName": "io.github.ChromeDevTools/chrome-devtools-mcp", "devDependencies": { "@eslint/js": "^9.35.0", - "@modelcontextprotocol/sdk": "1.20.1", + "@modelcontextprotocol/sdk": "1.20.2", "@rollup/plugin-commonjs": "^28.0.8", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", @@ -59,7 +59,7 @@ "eslint-plugin-import": "^2.32.0", "globals": "^16.4.0", "prettier": "^3.6.2", - "puppeteer": "24.26.0", + "puppeteer": "24.26.1", "rollup": "4.52.5", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-license": "^3.6.0", From 7160630573a9b1260592a7e5e48563c448b0855d Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Mon, 27 Oct 2025 13:59:03 +0100 Subject: [PATCH 2/5] switch to snapshots --- tests/McpResponse.test.js.snapshot | 35 ++++++++++++++++++++ tests/McpResponse.test.ts | 51 ++++++------------------------ 2 files changed, 44 insertions(+), 42 deletions(-) create mode 100644 tests/McpResponse.test.js.snapshot diff --git a/tests/McpResponse.test.js.snapshot b/tests/McpResponse.test.js.snapshot new file mode 100644 index 000000000..10df65233 --- /dev/null +++ b/tests/McpResponse.test.js.snapshot @@ -0,0 +1,35 @@ +exports[`McpResponse > returns correctly formatted snapshot for a simple tree 1`] = ` +# test response +## Page content +uid=1_0 RootWebArea "My test page" url="about:blank" + uid=1_1 button "Click me" focusable focused + uid=1_2 textbox value="Input" + +`; + +exports[`McpResponse > returns values for textboxes 1`] = ` +# test response +## Page content +uid=1_0 RootWebArea "My test page" url="about:blank" + uid=1_1 StaticText "username" + uid=1_2 textbox "username" focusable focused value="mcp" + +`; + +exports[`McpResponse > returns verbose snapshot 1`] = ` +# test response +## Page content +uid=1_0 RootWebArea "My test page" url="about:blank" + uid=1_1 ignored + uid=1_2 ignored + uid=1_3 complementary + uid=1_4 StaticText "test" + uid=1_5 InlineTextBox "test" + +`; + +exports[`McpResponse > saves snapshot to file 1`] = ` +# test response +## Page content +Saved snapshot to /tmp/test-screenshot.png. +`; diff --git a/tests/McpResponse.test.ts b/tests/McpResponse.test.ts index 1c6678d54..12c758c5d 100644 --- a/tests/McpResponse.test.ts +++ b/tests/McpResponse.test.ts @@ -51,7 +51,7 @@ Testing 2`, }); }); - it('returns correctly formatted snapshot for a simple tree', async () => { + it('returns correctly formatted snapshot for a simple tree', async t => { await withBrowser(async (response, context) => { const page = context.getSelectedPage(); await page.setContent( @@ -65,19 +65,11 @@ Testing 2`, response.includeSnapshot(); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); - assert.strictEqual( - result[0].text, - `# test response -## Page content -uid=1_0 RootWebArea "My test page" - uid=1_1 button "Click me" focusable focused - uid=1_2 textbox value="Input" -`, - ); + t.assert.snapshot?.(result[0].text); }); }); - it('returns values for textboxes', async () => { + it('returns values for textboxes', async t => { await withBrowser(async (response, context) => { const page = context.getSelectedPage(); await page.setContent( @@ -91,19 +83,11 @@ uid=1_0 RootWebArea "My test page" response.includeSnapshot(); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); - assert.strictEqual( - result[0].text, - `# test response -## Page content -uid=1_0 RootWebArea "My test page" - uid=1_1 StaticText "username" - uid=1_2 textbox "username" focusable focused value="mcp" -`, - ); + t.assert.snapshot?.(result[0].text); }); }); - it('returns verbose snapshot', async () => { + it('returns verbose snapshot', async t => { await withBrowser(async (response, context) => { const page = context.getSelectedPage(); await page.setContent(html``); @@ -112,22 +96,11 @@ uid=1_0 RootWebArea "My test page" }); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); - assert.strictEqual( - result[0].text, - `# test response -## Page content -uid=1_0 RootWebArea "My test page" - uid=1_1 ignored - uid=1_2 ignored - uid=1_3 complementary - uid=1_4 StaticText "test" - uid=1_5 InlineTextBox "test" -`, - ); + t.assert.snapshot?.(result[0].text); }); }); - it('saves snapshot to file', async () => { + it('saves snapshot to file', async t => { const filePath = join(tmpdir(), 'test-screenshot.png'); try { await withBrowser(async (response, context) => { @@ -139,18 +112,12 @@ uid=1_0 RootWebArea "My test page" }); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); - console.log(result[0].text); - assert.strictEqual( - result[0].text, - `# test response -## Page content -Saved snapshot to ${filePath}.`, - ); + t.assert.snapshot?.(result[0].text); }); const content = await readFile(filePath, 'utf-8'); assert.strictEqual( content, - `uid=1_0 RootWebArea "My test page" + `uid=1_0 RootWebArea "My test page" url="about:blank" uid=1_1 ignored uid=1_2 ignored uid=1_3 complementary From e0fcbcba4cd16ea85fb65da3d1007998bad4886a Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Mon, 27 Oct 2025 14:07:02 +0100 Subject: [PATCH 3/5] fix --- tests/McpResponse.test.js.snapshot | 10 ++++++++++ tests/McpResponse.test.ts | 12 ++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/McpResponse.test.js.snapshot b/tests/McpResponse.test.js.snapshot index 10df65233..482f2864d 100644 --- a/tests/McpResponse.test.js.snapshot +++ b/tests/McpResponse.test.js.snapshot @@ -33,3 +33,13 @@ exports[`McpResponse > saves snapshot to file 1`] = ` ## Page content Saved snapshot to /tmp/test-screenshot.png. `; + +exports[`McpResponse > saves snapshot to file 2`] = ` +uid=1_0 RootWebArea "My test page" url="about:blank" + uid=1_1 ignored + uid=1_2 ignored + uid=1_3 complementary + uid=1_4 StaticText "test" + uid=1_5 InlineTextBox "test" + +`; diff --git a/tests/McpResponse.test.ts b/tests/McpResponse.test.ts index 12c758c5d..d0655f8f3 100644 --- a/tests/McpResponse.test.ts +++ b/tests/McpResponse.test.ts @@ -115,16 +115,7 @@ Testing 2`, t.assert.snapshot?.(result[0].text); }); const content = await readFile(filePath, 'utf-8'); - assert.strictEqual( - content, - `uid=1_0 RootWebArea "My test page" url="about:blank" - uid=1_1 ignored - uid=1_2 ignored - uid=1_3 complementary - uid=1_4 StaticText "test" - uid=1_5 InlineTextBox "test" -`, - ); + t.assert.snapshot?.(content); } finally { await rm(filePath, {force: true}); } @@ -459,6 +450,7 @@ No requests found.`, ]; }; const result = await response.handle('test', context); + assert.strictEqual( result[0].text, `# test response From 907636ad9f8aade4ad3684dd6954acf73f55626c Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Mon, 27 Oct 2025 14:23:33 +0100 Subject: [PATCH 4/5] stabilize the snapshot content --- tests/McpResponse.test.js.snapshot | 2 +- tests/McpResponse.test.ts | 15 +++++++++++---- tests/utils.ts | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/McpResponse.test.js.snapshot b/tests/McpResponse.test.js.snapshot index 482f2864d..5f4794985 100644 --- a/tests/McpResponse.test.js.snapshot +++ b/tests/McpResponse.test.js.snapshot @@ -31,7 +31,7 @@ uid=1_0 RootWebArea "My test page" url="about:blank" exports[`McpResponse > saves snapshot to file 1`] = ` # test response ## Page content -Saved snapshot to /tmp/test-screenshot.png. +Saved snapshot to `; exports[`McpResponse > saves snapshot to file 2`] = ` diff --git a/tests/McpResponse.test.ts b/tests/McpResponse.test.ts index d0655f8f3..8ac546d16 100644 --- a/tests/McpResponse.test.ts +++ b/tests/McpResponse.test.ts @@ -9,7 +9,13 @@ import {tmpdir} from 'node:os'; import {join} from 'node:path'; import {describe, it} from 'node:test'; -import {getMockRequest, getMockResponse, html, withBrowser} from './utils.js'; +import { + getMockRequest, + getMockResponse, + html, + stabilizeResponseOutput, + withBrowser, +} from './utils.js'; describe('McpResponse', () => { it('list pages', async () => { @@ -100,7 +106,7 @@ Testing 2`, }); }); - it('saves snapshot to file', async t => { + it.only('saves snapshot to file', async t => { const filePath = join(tmpdir(), 'test-screenshot.png'); try { await withBrowser(async (response, context) => { @@ -112,10 +118,11 @@ Testing 2`, }); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); - t.assert.snapshot?.(result[0].text); + console.log(result[0].text); + t.assert.snapshot?.(stabilizeResponseOutput(result[0].text)); }); const content = await readFile(filePath, 'utf-8'); - t.assert.snapshot?.(content); + t.assert.snapshot?.(stabilizeResponseOutput(content)); } finally { await rm(filePath, {force: true}); } diff --git a/tests/utils.ts b/tests/utils.ts index 03cf84f91..6dca14a71 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -170,5 +170,8 @@ export function stabilizeResponseOutput(text: unknown) { // sec-ch-ua-platform:"Linux" const chUaPlatformRegEx = /sec-ch-ua-platform:"[a-zA-Z]*"/g; output = output.replaceAll(chUaPlatformRegEx, 'sec-ch-ua-platform:""'); + + const savedSnapshot = /Saved snapshot to (.*)/g; + output = output.replaceAll(savedSnapshot, 'Saved snapshot to '); return output; } From 4da20ab806dfc035db499d56ca7f288b241deb53 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Mon, 27 Oct 2025 14:26:54 +0100 Subject: [PATCH 5/5] fix --- tests/McpResponse.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/McpResponse.test.ts b/tests/McpResponse.test.ts index 8ac546d16..1de5ab863 100644 --- a/tests/McpResponse.test.ts +++ b/tests/McpResponse.test.ts @@ -106,7 +106,7 @@ Testing 2`, }); }); - it.only('saves snapshot to file', async t => { + it('saves snapshot to file', async t => { const filePath = join(tmpdir(), 'test-screenshot.png'); try { await withBrowser(async (response, context) => { @@ -118,7 +118,6 @@ Testing 2`, }); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); - console.log(result[0].text); t.assert.snapshot?.(stabilizeResponseOutput(result[0].text)); }); const content = await readFile(filePath, 'utf-8');