test: ipv6 proxy address (#9457)

This commit is contained in:
Yury Semikhatsky 2021-10-13 12:10:09 -07:00 committed by GitHub
parent 8b1a887756
commit fc54f1937a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,19 @@ it('should use proxy', async ({ contextFactory, server, proxyServer }) => {
await context.close();
});
it('should use ipv6 proxy', async ({ contextFactory, server, proxyServer, browserName }) => {
it.fail(browserName === 'firefox', 'page.goto: NS_ERROR_UNKNOWN_HOST');
proxyServer.forwardTo(server.PORT);
const context = await contextFactory({
proxy: { server: `[0:0:0:0:0:0:0:1]:${proxyServer.PORT}` }
});
const page = await context.newPage();
await page.goto('http://non-existent.com/target.html');
expect(proxyServer.requestUrls).toContain('http://non-existent.com/target.html');
expect(await page.title()).toBe('Served by the proxy');
await context.close();
});
it('should use proxy twice', async ({ contextFactory, server, proxyServer }) => {
proxyServer.forwardTo(server.PORT);
const context = await contextFactory({