chore(bidi): Fix launcher tests for Firefox

With the automatic HTTP to HTTPS upgrade the HTTP
proxy as defined via "firefoxUserPrefs" will not
be used. Instead directly use the HTTPS site and
proxy settings to workaround this feature.
This commit is contained in:
Henrik Skupin 2025-01-20 22:37:38 +01:00
parent cf3bcd7d4a
commit 5711c8e43a
No known key found for this signature in database
GPG key ID: AEB189C8ED815074

View file

@ -21,12 +21,12 @@ it('should pass firefox user preferences', async ({ browserType, mode }) => {
const browser = await browserType.launch({
firefoxUserPrefs: {
'network.proxy.type': 1,
'network.proxy.http': '127.0.0.1',
'network.proxy.http_port': 3333,
'network.proxy.ssl': '127.0.0.1',
'network.proxy.ssl_port': 3333,
}
});
const page = await browser.newPage();
const error = await page.goto('http://example.com').catch(e => e);
const error = await page.goto('https://example.com').catch(e => e);
expect(error.message).toContain('NS_ERROR_PROXY_CONNECTION_REFUSED');
await browser.close();
});
@ -36,10 +36,10 @@ it('should pass firefox user preferences in persistent', async ({ mode, launchPe
const { page } = await launchPersistent({
firefoxUserPrefs: {
'network.proxy.type': 1,
'network.proxy.http': '127.0.0.1',
'network.proxy.http_port': 3333,
'network.proxy.ssl': '127.0.0.1',
'network.proxy.ssl_port': 3333,
}
});
const error = await page.goto('http://example.com').catch(e => e);
const error = await page.goto('https://example.com').catch(e => e);
expect(error.message).toContain('NS_ERROR_PROXY_CONNECTION_REFUSED');
});