aaronontheweb avatar

Playwright Ci Caching

If you're running Playwright tests in CI, you're probably wasting 1-2 minutes per build downloading 400MB of browser binaries. This skill shows you how to cache them properly in GitHub Actions and Azure DevOps, with the cache key tied to your Playwright version from Directory.Packages.props so it automatically invalidates when you upgrade. The included playwright.ps1 helper script is clever because it discovers the Playwright CLI location regardless of your project structure, saving you from hardcoding paths that break. Battle-tested in production at Petabridge. The setup is straightforward and the time savings add up fast across dozens of CI runs.

skills.sh installs
455
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill playwright-ci-caching --agent claude-code

Installs into .claude/skills of the current project.

Files

Caching Playwright Browsers in CI/CD

When to Use This Skill

Use this skill when:

  • Setting up CI/CD for a project with Playwright E2E tests
  • Build times are slow due to browser downloads (~400MB, 1-2 minutes)
  • You want automatic cache invalidation when Playwright version changes
  • Using GitHub Actions or Azure DevOps pipelines

The Problem

Playwright browsers (~400MB) must be downloaded on every CI run by default. This:

  • Adds 1-2 minutes to every build
  • Wastes bandwidth
  • Can fail on transient network issues
  • Slows down PR feedback loops

Core Pattern

  1. Extract Playwright version from Directory.Packages.props (CPM) to use as cache key
  2. Cache browser binaries using platform-appropriate paths
  3. Conditional install - only download on cache miss
  4. Automatic cache bust - key includes version, so package upgrades invalidate cache

Cache Paths by OS

OSPath
Linux~/.cache/ms-playwright
macOS~/Library/Caches/ms-playwright
Windows%USERPROFILE%\AppData\Local\ms-playwright

GitHub Actions

Sponsors

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
Testing & QA, DevOps & CI/CD, Git & Pull Requests, Automation & Workflows, Cloud & Infrastructure, .NET & C#
First seen
Jun 3, 2026

More from aaronontheweb/dotnet-skills

All 34
1kevmoo avatardart-test-fundamentalskevmoo/dash_skillsCore concepts and best practices for `package:test`. Covers `test`, `group`, lifecycle methods (`setUp`, `tearDown`), and configuration (`dart_test.yaml`).455skills.sh installs
2aaronontheweb avatarakka-net-testing-patternsaaronontheweb/dotnet-skillsWrite unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, a431skills.sh installs
3mhattingpete avatartest-fixingmhattingpete/claude-skills-marketplaceRun tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite 386skills.sh installs
4levnikolaevich avatarln-404-test-executorlevnikolaevich/claude-code-skillsExecutes test tasks (label 'tests') through Todo to To Review with risk-based limits. Use for test task execution. Not for implementation tasks.378skills.sh installs
5levnikolaevich avatarln-635-test-isolation-auditorlevnikolaevich/claude-code-skillsAudits whether test results can be trusted: flakiness, isolation, real external dependencies, time/random/order dependency, and shared state. Use when auditing 376skills.sh installs
6levnikolaevich avatarln-633-test-value-auditorlevnikolaevich/claude-code-skillsScores each test by portfolio value and returns KEEP/DELETE/MERGE/REWRITE. Use when pruning test-suite cost.372skills.sh installs