From ddd7765ef468ed2a1cb2d5900e8cc95bdaf7e7d8 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 29 Mar 2023 00:34:26 +0200 Subject: [PATCH] test: fix Chromium headed credential tests (#22044) --- tests/library/browsercontext-credentials.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/library/browsercontext-credentials.spec.ts b/tests/library/browsercontext-credentials.spec.ts index d952c5b58f..be1dd3c993 100644 --- a/tests/library/browsercontext-credentials.spec.ts +++ b/tests/library/browsercontext-credentials.spec.ts @@ -99,7 +99,8 @@ it('should work with correct credentials and matching origin case insensitive', await context.close(); }); -it('should fail with correct credentials and mismatching scheme', async ({ browser, server }) => { +it('should fail with correct credentials and mismatching scheme', async ({ browser, server, browserName, headless }) => { + it.fail(browserName === 'chromium' && !headless); server.setAuth('/empty.html', 'user', 'pass'); const context = await browser.newContext({ httpCredentials: { username: 'user', password: 'pass', origin: server.PREFIX.replace('http://', 'https://') } @@ -110,7 +111,8 @@ it('should fail with correct credentials and mismatching scheme', async ({ brows await context.close(); }); -it('should fail with correct credentials and mismatching hostname', async ({ browser, server }) => { +it('should fail with correct credentials and mismatching hostname', async ({ browser, server, browserName, headless }) => { + it.fail(browserName === 'chromium' && !headless); server.setAuth('/empty.html', 'user', 'pass'); const hostname = new URL(server.PREFIX).hostname; const origin = server.PREFIX.replace(hostname, 'mismatching-hostname'); @@ -123,7 +125,8 @@ it('should fail with correct credentials and mismatching hostname', async ({ bro await context.close(); }); -it('should fail with correct credentials and mismatching port', async ({ browser, server }) => { +it('should fail with correct credentials and mismatching port', async ({ browser, server, browserName, headless }) => { + it.fail(browserName === 'chromium' && !headless); server.setAuth('/empty.html', 'user', 'pass'); const origin = server.PREFIX.replace(server.PORT.toString(), (server.PORT + 1).toString()); const context = await browser.newContext({