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
4 changes: 2 additions & 2 deletions tests/library/client-certificates.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ test.describe('browser', () => {

test('should not intercept TLS for origins without a client certificate', {
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41106' },
}, async ({ browser, asset, httpsServer, browserName, platform }) => {
}, async ({ browser, asset, httpsServer, browserName, platform, channel }) => {
// If the proxy intercepted this origin, the browser would see its self-signed cert (CN=localhost)
// instead of the real server cert (CN=playwright-test).
const page = await browser.newPage({
Expand All @@ -357,7 +357,7 @@ test.describe('browser', () => {
const response = await page.goto(httpsServer.EMPTY_PAGE);
expect(response.ok()).toBe(true);
const subjectName = (await response.securityDetails()).subjectName;
if (browserName === 'webkit' && platform === 'win32') {
if (browserName === 'webkit' && platform === 'win32' && channel !== 'webkit-wsl') {
// Don't ask me why this is "true" on Windows WebKit.
expect(subjectName).toContain('true');
} else {
Expand Down
5 changes: 4 additions & 1 deletion tests/library/har.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,10 @@ it('should return security details directly from response', async ({ contextFact
const page = await context.newPage();
const response = await page.goto(httpsServer.EMPTY_PAGE);
const securityDetails = await response!.securityDetails();
if (browserName === 'webkit' && platform === 'win32')
if (channel === 'webkit-wsl')
// The Linux WebKit build reports the real subject name, but (like the Windows port) does not surface the TLS protocol.
expect({ ...securityDetails, protocol: undefined }).toEqual({ subjectName: 'playwright-test', validFrom: 1691708270, validTo: 2007068270 });
else if (browserName === 'webkit' && platform === 'win32')
expect({ ...securityDetails, protocol: undefined }).toEqual({ subjectName: 'true', validFrom: 1691708270, validTo: 2007068270 });
else if (browserName === 'webkit')
expect(securityDetails).toEqual({ protocol: 'TLS 1.3', subjectName: 'playwright-test', validFrom: 1691708270, validTo: 2007068270 });
Expand Down
8 changes: 5 additions & 3 deletions tests/library/playwright-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ it.skip(({ mode }) => mode !== 'default');

const kBundlePath = path.join(__dirname, '..', '..', 'packages', 'playwright-client', 'lib', 'index.mjs');

it('should connect from a page and drive the same browser', async ({ browser, browserName, server }) => {
// Expose this very browser over a WebSocket endpoint.
const { endpoint } = await browser.bind('playwright-client-test', { port: 0 });
it('should connect from a page and drive the same browser', async ({ browser, browserName, channel, server }) => {
// Expose this very browser over a WebSocket endpoint. In WSL the browser runs in the
// guest and reaches the host over mirrored networking, which mirrors the IPv4 loopback
// but not the host's IPv6 `::1`; bind to 127.0.0.1 so the in-page client can connect back.
const { endpoint } = await browser.bind('playwright-client-test', { port: 0, host: channel === 'webkit-wsl' ? '127.0.0.1' : undefined });

// Serve the built browser client bundle.
server.setRoute('/playwright-client.mjs', (req, res) => {
Expand Down
Loading