test: fix Chromium headed credential tests (#22044)

This commit is contained in:
Max Schmitt 2023-03-29 00:34:26 +02:00 committed by GitHub
parent 3b359e27b7
commit ddd7765ef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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({