<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x" -->

---
title: When Tests Should Run Headless vs Headed in Playwright
description: Playwright ships two different Chromium binaries by default: a lightweight headless shell used for headless mode, and the full Chromium browser used for headed...
canonical: https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: When Tests Should Run Headless vs Headed in Playwright | daily.dev
og:description: Playwright ships two different Chromium binaries by default: a lightweight headless shell used for headless mode, and the full Chromium browser used for headed...
og:url: https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x
og:image: https://api.daily.dev/og/posts/hkBZ3cq0x.png
og:image:alt: When Tests Should Run Headless vs Headed in Playwright
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# When Tests Should Run Headless vs Headed in Playwright

**[Currents](https://daily.dev/sources/currents)** · 15 min read · 0 upvotes · 0 comments

## Summary

Playwright ships two different Chromium binaries by default: a lightweight headless shell used for headless mode, and the full Chromium browser used for headed mode. Because these are separate implementations with different rendering, GPU handling, and font rendering, tests that pass in one mode and fail in the other often reflect real behavioral differences rather than flakiness. The piece explains when to use headless (CI, scaling, scraping, routine checks) versus headed (debugging, animations, new test development), covers Chrome's newer 'new headless mode' (channel: 'chromium', available since Chrome 112) that uses the full browser without a window to eliminate most behavioral gaps, and walks through common failure categories: timing differences, font loading inconsistencies, GPU/WebGL performance gaps, and hover/layout issues. Recommends writing and debugging locally in headed mode, validating in headless mode in CI, using traces to debug CI-only failures, and avoiding mode-switching as a workaround for underlying test design problems.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://currents.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright>

## Questions this post answers

### Why does my Playwright test pass in headed mode but fail with a timeout in headless mode in CI?

Playwright uses two different Chromium binaries by default: a stripped-down chromium headless shell for headless mode and the full Chromium browser for headed mode. These are separate implementations with different rendering pipelines, GPU handling, and font rendering, so timing and behavior can genuinely differ rather than the failure being random flakiness.

_Track down browser-binary quirks like this one on daily.dev before they derail a CI pipeline._

### What is Playwright's new headless mode and how do I enable it?

Since Chrome 112, a new headless mode runs the full Chrome browser without a visible window, using the same rendering code as headed mode, unlike the default lightweight headless shell. Enable it in Playwright by setting channel: 'chromium' in the browser launch config; it eliminates most headless-vs-headed rendering differences at the cost of a larger binary and extra system library dependencies like libX11 and D-Bus in CI.

_Compare rendering-mode trade-offs like this on daily.dev when configuring Playwright for CI._

### Why does WebGL run so much slower in Playwright headless mode?

Headless shell, Playwright's default headless binary, disables GPU acceleration by default, forcing WebGL to fall back to software rendering or fail outright, while full Chromium in headed mode uses the system's real GPU. The performance gap can reach 10x or more for canvas-intensive operations; enabling flags like --use-gl=egl can help but requires EGL libraries installed on the CI host, or switching to new headless mode (channel: 'chromium') avoids the issue entirely.

_Debug GPU-related test slowdowns like this one with insights curated on daily.dev._

## Similar posts on daily.dev

- [Claude Code Playwright MCP: Fix Tests That Fail in CI](https://daily.dev/posts/claude-code-playwright-mcp-fix-tests-that-fail-in-ci-pbk4f7epo) · Currents · 2 upvotes · 1 comments
- [Vitest 4 Browser Mode: Component Testing Without Playwright](https://daily.dev/posts/vitest-4-browser-mode-component-testing-without-playwright-yq6se15sw) · SitePoint · 1 upvotes · 0 comments
- [Build a Playwright Framework with Isolated Browser State](https://daily.dev/posts/build-a-playwright-framework-with-isolated-browser-state-kl2th5rwl) · Medium · 7 upvotes · 0 comments
- [My experience writing automated tests for a SPA](https://daily.dev/posts/my-experience-writing-automated-tests-for-a-spa-xevl2tw5c) · Lobsters · 0 upvotes · 0 comments
- [AI Playwright Tests: MCP, CLI, Agents and Prompts Compared](https://daily.dev/posts/ai-playwright-tests-mcp-cli-agents-and-prompts-compared-mzhryxywm) · Currents · 3 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#chromium](https://daily.dev/tags/chromium)

[View this post on daily.dev](https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"When Tests Should Run Headless vs Headed in Playwright","url":"https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x"},"datePublished":"2026-09-06T08:56:42.286Z","dateModified":"2026-09-06T13:11:42.594Z","description":"Playwright ships two different Chromium binaries by default: a lightweight headless shell used for headless mode, and the full Chromium browser used for headed...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2d852538661c15c5cd30a3a5b474f269?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2d852538661c15c5cd30a3a5b474f269?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Currents","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Currents","logo":"https://media.daily.dev/image/upload/s--RxsiMZ1S--/f_auto,q_auto/v1788684994/logos/currents?_a=BAMAMicg0","url":"https://daily.dev/sources/currents"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,chromium","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Currents","item":"https://daily.dev/sources/currents"},{"@type":"ListItem","position":3,"name":"When Tests Should Run Headless vs Headed in Playwright"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/when-tests-should-run-headless-vs-headed-in-playwright-hkbz3cq0x#faq","mainEntity":[{"@type":"Question","name":"Why does my Playwright test pass in headed mode but fail with a timeout in headless mode in CI?","acceptedAnswer":{"@type":"Answer","text":"Playwright uses two different Chromium binaries by default: a stripped-down chromium headless shell for headless mode and the full Chromium browser for headed mode. These are separate implementations with different rendering pipelines, GPU handling, and font rendering, so timing and behavior can genuinely differ rather than the failure being random flakiness. Track down browser-binary quirks like this one on daily.dev before they derail a CI pipeline."}},{"@type":"Question","name":"What is Playwright's new headless mode and how do I enable it?","acceptedAnswer":{"@type":"Answer","text":"Since Chrome 112, a new headless mode runs the full Chrome browser without a visible window, using the same rendering code as headed mode, unlike the default lightweight headless shell. Enable it in Playwright by setting channel: 'chromium' in the browser launch config; it eliminates most headless-vs-headed rendering differences at the cost of a larger binary and extra system library dependencies like libX11 and D-Bus in CI. Compare rendering-mode trade-offs like this on daily.dev when configuring Playwright for CI."}},{"@type":"Question","name":"Why does WebGL run so much slower in Playwright headless mode?","acceptedAnswer":{"@type":"Answer","text":"Headless shell, Playwright's default headless binary, disables GPU acceleration by default, forcing WebGL to fall back to software rendering or fail outright, while full Chromium in headed mode uses the system's real GPU. The performance gap can reach 10x or more for canvas-intensive operations; enabling flags like --use-gl=egl can help but requires EGL libraries installed on the CI host, or switching to new headless mode (channel: 'chromium') avoids the issue entirely. Debug GPU-related test slowdowns like this one with insights curated on daily.dev."}}]}
```

