Playwright error page.goto: net::ERR_CONNECTION_REFUSED
Playwright tried to navigate to a URL where nothing is listening yet. Usually the dev/test server wasn't ready.
Why this happens
- The app/dev server isn't running at the target baseURL/port
- Playwright's `webServer` config started the server but tests began before it finished booting
- Wrong host or port configured in `baseURL`
How to fix it
- Confirm the server is actually listening on that exact port before tests start
- Use the `webServer` option in playwright.config.ts with a `url` health check so Playwright waits for readiness
- Increase `webServer.timeout` if the app is slow to boot, especially in CI