Playwright error

page.goto: net::ERR_CERT_AUTHORITY_INVALID

The browser doesn't trust the TLS certificate of the site under test. Common with self-signed certificates on local, staging, and preview environments.

Published

Why this happens

How to fix it

  1. For test environments you control, set `ignoreHTTPSErrors: true` in the `use` block of playwright.config.ts
  2. Scope it to the non-production projects only, so a genuinely broken certificate on production still fails loudly
  3. Better long term: give staging a real certificate (e.g. Let's Encrypt) so tests don't need the bypass at all

Example


              // playwright.config.ts
export default defineConfig({
  projects: [
    {
      name: 'staging',
      use: { baseURL: 'https://staging.internal', ignoreHTTPSErrors: true },
    },
  ],
});