Self-signed certificates
By default Playwright validates TLS certificates like a real browser, so a target using a self-signed or internally-issued certificate makes every page.goto(...) fail with net::ERR_CERT_AUTHORITY_INVALID before the test logic even runs.
There is no plugin-level toggle for this — it is set explicitly in the transaction with Playwright's own test.use():
import { test, expect } from '@playwright/test';
test.use({ ignoreHTTPSErrors: true });
test('checkout flow', async ({ page }) => {
await page.goto('https://internal.example.com');
// ...
});
-
test.use({ ignoreHTTPSErrors: true })at the top level of the file applies to everytest(...)below it. - To scope it to only some tests in the same file, wrap them in their own
test.describe(...)block and calltest.use({ ignoreHTTPSErrors: true })as the first line inside that block instead of at the top level. - This only disables certificate validation, not TLS itself — the connection stays encrypted, it just no longer requires a trusted CA chain.