mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: fix client-certificates tests on Windows (#31750)
This commit is contained in:
parent
e78ce8521d
commit
453e3bdf9d
@ -661,7 +661,7 @@ export function assertBrowserContextIsNotOwned(context: BrowserContext) {
|
||||
export async function createClientCertificatesProxyIfNeeded(options: channels.BrowserNewContextOptions, browserOptions?: BrowserOptions) {
|
||||
if (!options.clientCertificates?.length)
|
||||
return;
|
||||
if (options.proxy?.server || browserOptions?.proxy?.server)
|
||||
if ((options.proxy?.server && options.proxy?.server !== 'per-context') || (browserOptions?.proxy?.server && browserOptions?.proxy?.server !== 'http://per-context'))
|
||||
throw new Error('Cannot specify both proxy and clientCertificates');
|
||||
verifyClientCertificates(options.clientCertificates);
|
||||
const clientCertificatesProxy = new ClientCertificatesProxy(options);
|
||||
|
@ -56,6 +56,15 @@ const test = base.extend<{ serverURL: string, serverURLRewrittenToLocalhost: str
|
||||
}
|
||||
});
|
||||
|
||||
test.use({
|
||||
launchOptions: async ({ launchOptions }, use) => {
|
||||
await use({
|
||||
...launchOptions,
|
||||
proxy: { server: 'per-context' }
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test.skip(({ mode }) => mode !== 'default');
|
||||
|
||||
const kDummyFileName = __filename;
|
||||
@ -174,8 +183,6 @@ test.describe('fetch', () => {
|
||||
|
||||
|
||||
test.describe('browser', () => {
|
||||
test.skip(({ browserName, platform, browserMajorVersion }) => browserName === 'chromium' && platform === 'win32' && browserMajorVersion < 128, 'Depends on https://chromium-review.googlesource.com/c/chromium/src/+/5688851');
|
||||
|
||||
test('validate input', async ({ browser }) => {
|
||||
for (const [contextOptions, expected] of kValidationSubTests)
|
||||
await expect(browser.newContext(contextOptions)).rejects.toThrow(expected);
|
||||
|
Loading…
x
Reference in New Issue
Block a user