Playwright Config Generator
Build a playwright.config.ts file visually.
Choose browsers, set timeouts and retries, pick reporters, and configure screenshot/video/trace collection.
Copy the ready-to-use output directly into your project.
Frequently Asked Questions
What is playwright.config.ts used for?▼
playwright.config.ts (or .js) is the central configuration file for Playwright Test. It defines which browsers to test, timeouts, retry counts, reporters, artifact collection (screenshots, video, traces), and test file patterns. Every setting has a sensible default, so you only need to configure what differs from the defaults.
How many browsers should I test?▼
For most web apps, starting with Chromium alone covers ~65% of users and is fastest. Add Firefox for cross-browser compatibility. Add WebKit (Safari) if you have macOS/iOS users. Testing all three gives the best coverage but roughly triples test time. Use the --project flag to run a single browser in CI for speed: `npx playwright test --project=chromium`.
What are retries and when should I use them?▼
Retries re-run a failed test up to N times before marking it as failed. Use 0 in local development (fail fast, debug immediately). Use 1-2 in CI to handle flaky tests caused by network timing or race conditions. Never use retries to mask genuinely broken tests — fix the root cause instead.
What is the difference between trace, video, and screenshot?▼
Screenshots capture the page state at the moment of failure. Videos record the full test run as an mp4. Traces (Playwright Trace Viewer) capture network requests, console logs, DOM snapshots, and an action timeline — the most powerful debugging artifact. `retain-on-failure` and `on-first-retry` are good balanced defaults that only collect artifacts when tests fail, saving disk space.
What does fullyParallel mean?▼
When fullyParallel is true, each individual test runs in parallel across workers. When false, each test file runs in one worker but files run in parallel. fullyParallel: true is faster for suites with many small tests. Set workers to '50%' or '100%' to use multiple CPU cores. In CI, typically use workers: 1 for serial execution to avoid resource contention.
How does the webServer option work?▼
The webServer config tells Playwright to auto-start your dev server (e.g., `npm run dev`) before running tests and wait for it to be ready. Set reuseExistingServer: !process.env.CI so it reuses an already-running server locally but always starts fresh in CI. This avoids port conflicts and ensures tests always run against the correct version.
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →You Might Also Need
Playwright E2E Test Generator
Generate Playwright end-to-end test code visually. Add click, fill, expect, and navigate steps, toggle TypeScript/JavaScript, and copy the test code.
Open free tool →
Playwright E2E Testing Guide
Complete Playwright end-to-end testing guide. Learn locators, auto-wait, fixtures, network interception, API testing, Trace Viewer, and multi-browser automation.
Open free tool →
Playwright Test Generator
Generate Playwright end-to-end test code in TypeScript instantly. Configure browser target, test type, and locators to get ready-to-run Playwright tests with page.goto, Locator API, and expect assertions.
Open free tool →
More Free Tools
Related Articles
Playwright vs Selenium 2026: Which Should You Choose?
Complete comparison of Playwright and Selenium for browser automation and end-to-end testing in 2026. Performance benchmarks, API differences, migration guide, and when to use each.
Playwright E2E Testing Guide 2026: Complete Setup & Best Practices
A complete guide to Playwright end-to-end testing in 2026. Covers installation, Page Object Model, visual regression, parallel execution, GitHub Actions CI, and debugging techniques with TypeScript examples.
End-to-End Testing in 2026: Writing Tests That Don't Lie
E2E testing guide 2026: choose Playwright or Cypress, eliminate flakiness, structure test suites for CI/CD, and understand real application quality limits.
Playwright vs Cypress vs Puppeteer: E2E Testing in 2026
Comprehensive comparison of Playwright, Cypress, and Puppeteer for end-to-end testing in 2026. Speed, API design, CI/CD integration, cross-browser support, and when to choose each tool.
Playwright vs Cypress vs Selenium: E2E Testing Framework Comparison 2026
Compare Playwright, Cypress, and Selenium for end-to-end testing. Speed, browser support, DX, CI integration, and which framework to choose in 2026.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →