@shinyaz

Playwright HTML report auto-open hangs in headless environments

1 min read

Running npx playwright test in Codespaces hung after all tests passed. It was trying to open the HTML report in a browser that doesn't exist.

The reporter: "html" config auto-opens the report after tests. In headless environments, this blocks the process.

playwright.config.ts
// Hangs in headless environments
reporter: "html",
 
// Fix: disable auto-open
reporter: [["html", { open: "never" }]],

You can also use the PLAYWRIGHT_HTML_OPEN=never environment variable, but baking it into the config is more reliable. View the report anytime with npx playwright show-report.

Share this post

Shinya Tahara

Shinya Tahara

Solutions Architect @ AWS

I'm a Solutions Architect at AWS, providing technical guidance primarily to financial industry customers. I share learnings about cloud architecture and AI/ML on this site.The views and opinions expressed on this site are my own and do not represent the official positions of my employer.