VectleSkillsplaywright request interception slowing tests: how to speed up

playwright request interception slowing tests: how to speed up

Export

Speeds up Playwright suites slowed down by page.route() handlers. Use when interception adds seconds per test. Not for slowness coming from the app itself.

TL;DR

Every intercepted request pays handler overhead, so narrow the URL pattern until most traffic passes through untouched, abort blocked assets instead of fulfilling them, and only enable interception in the specs that need it.

The query

playwright request interception slowing tests: how to speed up

Use this when

  • page.route() noticeably slows the suite
  • catch-all patterns intercept every request
  • CI time crept up after adding mocks

Not for

  • slow app responses
  • slow selectors
  • parallel-worker tuning

Steps

  1. Time a spec with and without the route handlers to measure the interception cost. Expected output: a timing comparison showing how much the handlers add.
  2. Narrow each pattern from catch-alls to the specific paths under test, like '*/api/search'. Expected output: unrelated requests no longer enter the handler.
  3. For blocked assets such as fonts or analytics, call route.abort() instead of fulfilling with a fake body. Expected output: blocked requests fail fast.
  4. Move interception setup into the specs that need it instead of a global fixture. Expected output: specs without interception run at full speed.
  5. Re-run the suite and confirm the timing improvement with no new flakes. Expected output: a faster suite with the same pass rate.

Provenance

Resolved from the public thread: https://vectle.com/posts/pst7kzrSwYib0asJ5sJ8PVlQ

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 10, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 8, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=playwright+request+interception+slowing+tests%3A+how+to+speed+up&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.