diff --git a/packages/html-reporter/src/filter.ts b/packages/html-reporter/src/filter.ts
index 36da5554643d3..470f6b8b58827 100644
--- a/packages/html-reporter/src/filter.ts
+++ b/packages/html-reporter/src/filter.ts
@@ -204,7 +204,7 @@ function cacheSearchValues(test: TestCaseSummary & { [searchValuesSymbol]?: Sear
line: String(test.location.line),
column: String(test.location.column),
labels: test.tags.map(tag => tag.toLowerCase()),
- annotations: test.annotations.map(a => a.type.toLowerCase() + '=' + a.description?.toLocaleLowerCase())
+ annotations: test.annotations.map(a => a.type.toLowerCase() + '=' + (a.description ?? '').toLowerCase())
};
test[searchValuesSymbol] = searchValues;
return searchValues;
diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json
index d12a5e8669e55..1e5a956654504 100644
--- a/packages/playwright-core/browsers.json
+++ b/packages/playwright-core/browsers.json
@@ -45,7 +45,7 @@
},
{
"name": "webkit",
- "revision": "2306",
+ "revision": "2309",
"installByDefault": true,
"revisionOverrides": {
"mac14": "2251",
diff --git a/packages/playwright-core/src/tools/cli-client/program.ts b/packages/playwright-core/src/tools/cli-client/program.ts
index 1d9dc5d657c2d..0b87a30bae33a 100644
--- a/packages/playwright-core/src/tools/cli-client/program.ts
+++ b/packages/playwright-core/src/tools/cli-client/program.ts
@@ -168,7 +168,7 @@ export async function program(options?: { embedderVersion?: string}) {
}
const cdpChannel = typeof args.cdp === 'string' && isKnownChannel(args.cdp) ? args.cdp : undefined;
- const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.cdp as string;
+ const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.endpoint as string ?? args.cdp as string;
if (!targetName)
output.errorAttachNoTarget();
const attachSessionName = explicitSessionName(args.session as string) ?? attachTarget ?? cdpChannel ?? extensionChannel ?? sessionName;
diff --git a/packages/playwright-core/src/tools/mcp/browserFactory.ts b/packages/playwright-core/src/tools/mcp/browserFactory.ts
index e6b808459c5ac..70cf0878e55d7 100644
--- a/packages/playwright-core/src/tools/mcp/browserFactory.ts
+++ b/packages/playwright-core/src/tools/mcp/browserFactory.ts
@@ -147,6 +147,10 @@ async function createRemoteBrowser(config: FullConfig): Promise
// Use connectToBrowser instead of playwright[browserName].connect because we don't have browserName.
const browser = await connectToBrowser(playwrightObject, remoteOptions);
browser._connectToBrowserType(playwrightObject[browser._browserName], {}, undefined);
+ // A browser started via `launchServer` exposes no contexts until one is
+ // created, so create one when attaching to such a server.
+ if (!browser.contexts().length)
+ await browser.newContext(config.browser.contextOptions);
return { browser, browserInfo: browserInfo(browser, config), canBind: false, ownership: 'attached' };
}
diff --git a/tests/mcp/cli-endpoint.spec.ts b/tests/mcp/cli-endpoint.spec.ts
new file mode 100644
index 0000000000000..0fa4519e32076
--- /dev/null
+++ b/tests/mcp/cli-endpoint.spec.ts
@@ -0,0 +1,31 @@
+/**
+ * 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 { test, expect } from './cli-fixtures';
+
+test('attach --endpoint keeps the default session', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41154' } }, async ({ wsEndpoint, cli, server }) => {
+ const { exitCode, error } = await cli('attach', `--endpoint=${wsEndpoint}`);
+ expect(error).not.toContain('no target specified');
+ expect(exitCode).toBe(0);
+
+ const { output: listOutput } = await cli('list');
+ expect(listOutput).toContain('- default:');
+ expect(listOutput).toContain('(attached)');
+
+ await cli('goto', server.HELLO_WORLD);
+ const { inlineSnapshot } = await cli('snapshot');
+ expect(inlineSnapshot).toContain('Hello, world!');
+});
diff --git a/tests/playwright-test/stable-test-runner/package-lock.json b/tests/playwright-test/stable-test-runner/package-lock.json
index 7ebb02a95b13f..33b4ad64d3c4d 100644
--- a/tests/playwright-test/stable-test-runner/package-lock.json
+++ b/tests/playwright-test/stable-test-runner/package-lock.json
@@ -5,16 +5,16 @@
"packages": {
"": {
"dependencies": {
- "@playwright/test": "^1.61.0-alpha-2026-06-01"
+ "@playwright/test": "^1.61.0-alpha-1781023400000"
}
},
"node_modules/@playwright/test": {
- "version": "1.61.0-alpha-2026-06-01",
- "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.0-alpha-2026-06-01.tgz",
- "integrity": "sha512-eE/Hz7GLQeymq0axISbYtgpeBIltzcAbWFY8algIzSwPsyvTFt8mCh/mKJJl8zUjOFz2EtL8OVedDL8stKNS/Q==",
+ "version": "1.61.0-alpha-1781023400000",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.0-alpha-1781023400000.tgz",
+ "integrity": "sha512-EYeA59CsSOtiQgKTBAyl321SwaWzLYD4wU9GDAt8kFpYCco3sClPZBPdKXdUwlrNqOFAbseUYtiFudxFs/h02w==",
"license": "Apache-2.0",
"dependencies": {
- "playwright": "1.61.0-alpha-2026-06-01"
+ "playwright": "1.61.0-alpha-1781023400000"
},
"bin": {
"playwright": "cli.js"
@@ -38,12 +38,12 @@
}
},
"node_modules/playwright": {
- "version": "1.61.0-alpha-2026-06-01",
- "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.0-alpha-2026-06-01.tgz",
- "integrity": "sha512-tBlatMRW9V7IZl50faQpIkHs7qz7U5oxw2raeDRlc1uMd91hVpsE6XIp2fY1Z6hVIYkQeCeO3I5NP9J5vKbSvQ==",
+ "version": "1.61.0-alpha-1781023400000",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.0-alpha-1781023400000.tgz",
+ "integrity": "sha512-8TRUG3IvwaAhuVm6k3C5vB7CwC5Fxq76DCCxOgPr6r1dpTedDwxlmdOBUkSZ0zxfxP14jcuPxi86/Trq4eA03w==",
"license": "Apache-2.0",
"dependencies": {
- "playwright-core": "1.61.0-alpha-2026-06-01"
+ "playwright-core": "1.61.0-alpha-1781023400000"
},
"bin": {
"playwright": "cli.js"
@@ -56,9 +56,9 @@
}
},
"node_modules/playwright-core": {
- "version": "1.61.0-alpha-2026-06-01",
- "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.0-alpha-2026-06-01.tgz",
- "integrity": "sha512-QP5JCCuFJ+Yoh3dbXqSHVqV76VblK1T+dFIDs9RI9iRCEU/hlOpvt9cKJJXivVo7i+9XJgYfs2ERzvCaNZ0Y/g==",
+ "version": "1.61.0-alpha-1781023400000",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.0-alpha-1781023400000.tgz",
+ "integrity": "sha512-UdtUd9qnCO0zvb8p3OvOZpelY6mA40mTb3NmWGuMtrD+hqqWuorWCPlSGwj7jw/LEB9AxvYLHTL1CJi2flvksg==",
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
diff --git a/tests/playwright-test/stable-test-runner/package.json b/tests/playwright-test/stable-test-runner/package.json
index 307d2f5489376..cab864290397d 100644
--- a/tests/playwright-test/stable-test-runner/package.json
+++ b/tests/playwright-test/stable-test-runner/package.json
@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
- "@playwright/test": "^1.61.0-alpha-2026-06-01"
+ "@playwright/test": "^1.61.0-alpha-1781023400000"
}
}