Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/html-reporter/src/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
{
"name": "webkit",
"revision": "2306",
"revision": "2309",
"installByDefault": true,
"revisionOverrides": {
"mac14": "2251",
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/tools/cli-client/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions packages/playwright-core/src/tools/mcp/browserFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ async function createRemoteBrowser(config: FullConfig): Promise<BrowserWithInfo>
// 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' };
}

Expand Down
31 changes: 31 additions & 0 deletions tests/mcp/cli-endpoint.spec.ts
Original file line number Diff line number Diff line change
@@ -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!');
});
24 changes: 12 additions & 12 deletions tests/playwright-test/stable-test-runner/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/playwright-test/stable-test-runner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"@playwright/test": "^1.61.0-alpha-2026-06-01"
"@playwright/test": "^1.61.0-alpha-1781023400000"
}
}
Loading