<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr" -->

---
title: How To Speed Up Playwright Tests: 7 Tips From Experts
description: Seven practical techniques for speeding up Playwright test suites in CI: using workers and fullyParallel effectively, sharding tests across machines (and why...
canonical: https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How To Speed Up Playwright Tests: 7 Tips From Experts | daily.dev
og:description: Seven practical techniques for speeding up Playwright test suites in CI: using workers and fullyParallel effectively, sharding tests across machines (and why...
og:url: https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr
og:image: https://api.daily.dev/og/posts/2MooS0yBr.png
og:image:alt: How To Speed Up Playwright Tests: 7 Tips From Experts
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.

# How To Speed Up Playwright Tests: 7 Tips From Experts

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

## Summary

Seven practical techniques for speeding up Playwright test suites in CI: using workers and fullyParallel effectively, sharding tests across machines (and why lexical sharding is unbalanced), avoiding unnecessary page reloads by switching to domcontentloaded and moving navigation into beforeEach, running headless in CI for 10-30% speed gains, applying fail-fast via maxFailures to stop suites after early failures, running only changed tests with Playwright v1.46's --only-changed flag, using persistent authentication via storageState to cut auth time from 25 minutes to 10 seconds, and blocking unnecessary network resources like images, fonts, and third-party scripts. Also covers ongoing monitoring of average test duration, flakiness rate, and CI resource usage to keep suites fast over time.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://currents.dev/posts/how-to-speed-up-playwright-tests>

## Questions this post answers

### How can I reduce Playwright test suite runtime with parallel workers and sharding?

Parallel workers and sharding can cut a 100-test suite from about 50 minutes on one worker down to 12-15 minutes with four workers, and further to 7-10 minutes when split into four shards across machines. Sharding distributes test files across multiple machines but by default splits by lexical file path order, which can create unbalanced workloads on larger suites.

_See how daily.dev surfaces practical CI speedup techniques for teams scaling Playwright suites._

### How do I speed up repeated login steps in Playwright tests?

Use Playwright's storageState to log in once, save cookies, local storage, and session tokens, then load that saved state before each test instead of repeating the login flow. This can reduce authentication time from around 25 minutes to roughly 10 seconds across a 100-test suite. Session storage isn't included by default and must be captured and restored manually with addInitScript if needed.

_Developers tuning CI pipelines can find more Playwright authentication patterns like this on daily.dev._

### What does the --only-changed flag do in Playwright v1.46?

The --only-changed flag, added in Playwright v1.46, runs only tests affected by changed files, comparing against HEAD by default or against a base branch for feature branches, including tests that statically import changed files. It relies on static file dependency analysis, so it misses indirect dependencies, runtime imports, and environment-driven behavior, making a hybrid approach with periodic full suite runs safer.

_Teams weighing test-impact analysis tradeoffs can track Playwright updates like this on daily.dev._

## Similar posts on daily.dev

- [How to speed up tests for AI coding agents](https://daily.dev/posts/how-to-speed-up-tests-for-ai-coding-agents-oxj0juc2z) · Flavio Copes · 1 upvotes · 0 comments
- [Playwright Tags and Annotations: Organize Large CI Suites](https://daily.dev/posts/playwright-tags-and-annotations-organize-large-ci-suites-s0yxpg2ir) · Currents · 0 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 · 6 upvotes · 0 comments
- [How to Build Reliable Stateful Browser Automation with Playwright](https://daily.dev/posts/how-to-build-reliable-stateful-browser-automation-with-playwright-qqzelgknv) · SitePoint · 0 upvotes · 1 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

---

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

[View this post on daily.dev](https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr)

```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":"How To Speed Up Playwright Tests: 7 Tips From Experts","url":"https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr"},"datePublished":"2026-09-06T08:56:39.159Z","dateModified":"2026-09-06T13:11:41.925Z","description":"Seven practical techniques for speeding up Playwright test suites in CI: using workers and fullyParallel effectively, sharding tests across machines (and why...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f148473feb33253509d0d80c9482267a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f148473feb33253509d0d80c9482267a?_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/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,cicd","timeRequired":"PT17M"}
{"@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":"How To Speed Up Playwright Tests: 7 Tips From Experts"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-speed-up-playwright-tests-7-tips-from-experts-2moos0ybr#faq","mainEntity":[{"@type":"Question","name":"How can I reduce Playwright test suite runtime with parallel workers and sharding?","acceptedAnswer":{"@type":"Answer","text":"Parallel workers and sharding can cut a 100-test suite from about 50 minutes on one worker down to 12-15 minutes with four workers, and further to 7-10 minutes when split into four shards across machines. Sharding distributes test files across multiple machines but by default splits by lexical file path order, which can create unbalanced workloads on larger suites. See how daily.dev surfaces practical CI speedup techniques for teams scaling Playwright suites."}},{"@type":"Question","name":"How do I speed up repeated login steps in Playwright tests?","acceptedAnswer":{"@type":"Answer","text":"Use Playwright's storageState to log in once, save cookies, local storage, and session tokens, then load that saved state before each test instead of repeating the login flow. This can reduce authentication time from around 25 minutes to roughly 10 seconds across a 100-test suite. Session storage isn't included by default and must be captured and restored manually with addInitScript if needed. Developers tuning CI pipelines can find more Playwright authentication patterns like this on daily.dev."}},{"@type":"Question","name":"What does the --only-changed flag do in Playwright v1.46?","acceptedAnswer":{"@type":"Answer","text":"The --only-changed flag, added in Playwright v1.46, runs only tests affected by changed files, comparing against HEAD by default or against a base branch for feature branches, including tests that statically import changed files. It relies on static file dependency analysis, so it misses indirect dependencies, runtime imports, and environment-driven behavior, making a hybrid approach with periodic full suite runs safer. Teams weighing test-impact analysis tradeoffs can track Playwright updates like this on daily.dev."}}]}
```

