You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚀 Feature Request: Detect and Remove Obsolete Snapshots in Playwright
Problem Statement
When using Playwright's Visual Regression Testing (toHaveScreenshot()), old or unused snapshot files accumulate over time. Currently, Playwright does not have a built-in way to:
Detect obsolete snapshots that are no longer referenced in tests.
Automatically delete these stale snapshots.
This leads to bloated repositories with unnecessary files, making it harder to manage snapshot updates efficiently.
Proposed Solution
Introduce a new CLI flag, such as:
npx playwright test --cleanup-snapshots
Example
Currently, developers update snapshots using:
npx playwright test --update-snapshots
However, this only updates existing snapshots and does not remove obsolete ones.
With the proposed feature, developers could run:
npx playwright test --cleanup-snapshots
Motivation
Over time, as tests are renamed or removed, unused snapshot files accumulate in __snapshots__/, leading to:
Wasted storage: Unused snapshots bloat the repository.
Slower updates: The more snapshots exist, the longer updates take.
Harder maintenance: Developers have to manually clean snapshots.
By introducing a --cleanup-snapshots flag, Playwright can automatically remove outdated snapshots, improving efficiency and test maintainability.
This feature aligns with Playwright’s goal of providing developer-friendly and scalable test automation. 🚀
The text was updated successfully, but these errors were encountered:
🚀 Feature Request
🚀 Feature Request: Detect and Remove Obsolete Snapshots in Playwright
Problem Statement
When using Playwright's Visual Regression Testing (
toHaveScreenshot()
), old or unused snapshot files accumulate over time. Currently, Playwright does not have a built-in way to:This leads to bloated repositories with unnecessary files, making it harder to manage snapshot updates efficiently.
Proposed Solution
Introduce a new CLI flag, such as:
npx playwright test --cleanup-snapshots
Example
Currently, developers update snapshots using:
However, this only updates existing snapshots and does not remove obsolete ones.
With the proposed feature, developers could run:
Motivation
Over time, as tests are renamed or removed, unused snapshot files accumulate in
__snapshots__/
, leading to:By introducing a
--cleanup-snapshots
flag, Playwright can automatically remove outdated snapshots, improving efficiency and test maintainability.This feature aligns with Playwright’s goal of providing developer-friendly and scalable test automation. 🚀
The text was updated successfully, but these errors were encountered: