diff --git a/README.md b/README.md index ec77935..e3be5df 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ tunnel: { tunnelIdentifier: process.env.TB_TUNNEL_ID, start: false } The tunnel needs Java (17 for tunnel 5.0, 11 for older versions). -**HTTPS through the tunnel.** By default TestingBot Tunnel decrypts HTTPS (SSL bumping) with a TestingBot certificate. The Playwright browsers on TestingBot do not trust that certificate, so `https://` sites fail with `ERR_CERT_AUTHORITY_INVALID`. This package therefore starts the tunnel with `noBump: true` unless you set `noBump` yourself. If you need bumping (for example for a site with a self-signed certificate), pass `noBump: false` and set `ignoreHTTPSErrors: true` in `use`. +**HTTPS through the tunnel.** TestingBot Tunnel decrypts HTTPS (SSL bumping) with a TestingBot certificate, and the Playwright browsers on TestingBot trust that certificate in tunnel sessions. Firefox only does so with Playwright 1.53 or later; on older versions pass `noBump: true` to forward HTTPS untouched. You can also use the setup on its own: diff --git a/src/config.ts b/src/config.ts index abdb7b4..d602f14 100644 --- a/src/config.ts +++ b/src/config.ts @@ -110,9 +110,6 @@ export function withTestingBot(config: PlaywrightTestConfig generateTunnelIdentifier()) if (start) tunnelMetadata = { ...tunnelOptions, tunnelIdentifier } } diff --git a/test/config.test.ts b/test/config.test.ts index ef6a471..f354281 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -92,7 +92,7 @@ describe('withTestingBot', () => { expect(id).toMatch(/^playwright-/) expect(e.TESTINGBOT_PLAYWRIGHT_TUNNEL_IDENTIFIER).toBe(id) expect(config.globalSetup).toEqual([path.join(__dirname, '..', 'src', 'global-setup.js'), './my-setup.ts']) - expect((config.metadata as any).testingbot.tunnel).toEqual({ verbose: true, noBump: true, tunnelIdentifier: id }) + expect((config.metadata as any).testingbot.tunnel).toEqual({ verbose: true, tunnelIdentifier: id }) expect(decodeCapabilities(use(config.projects![0]).connectOptions.wsEndpoint)['tb:options'].tunnelIdentifier).toBe(id) // Same identifier when the config is loaded again in a worker. expect(use(withTestingBot({}, { env: e, tunnel: true }).projects![0]).testingbot.tunnelIdentifier).toBe(id) @@ -105,9 +105,10 @@ describe('withTestingBot', () => { expect((config.metadata as any).testingbot.tunnel).toBe(false) }) - it('keeps noBump when set explicitly', () => { - const config = withTestingBot({}, { env: env(), tunnel: { noBump: false } }) - expect((config.metadata as any).testingbot.tunnel.noBump).toBe(false) + it('leaves SSL bumping to the tunnel unless noBump is set', () => { + expect((withTestingBot({}, { env: env(), tunnel: true }).metadata as any).testingbot.tunnel).not.toHaveProperty('noBump') + const config = withTestingBot({}, { env: env(), tunnel: { noBump: true } }) + expect((config.metadata as any).testingbot.tunnel.noBump).toBe(true) }) it('adds the reporter after the configured reporters', () => {