Summary
Layout regressions like unwanted scrollbar appearance, element clipping, or overlay misalignment cannot be detected by interaction-based e2e tests alone. In the 3.0.4 cycle, the scrollbar regression at sheet edges was only found through manual testing. Introduce Visual Regression Testing (VRT) using Playwright's built-in toHaveScreenshot() to catch these automatically.
Reference Issues
No response
Basic Example
Append screenshot assertions to existing e2e tests to avoid additional URL accesses:
// At the end of an existing test
await expect(page.locator('.gs-tabular')).toHaveScreenshot();
Priority targets:
- Sheets where content fits exactly (scrollbar edge cases)
- Cell selection at right/bottom edges
- Overlay positioning after CSS resize
- Autofill handle visibility
CI environment should be fixed (e.g., Docker / GitHub Actions Linux) for consistent scrollbar rendering and font baselines.
Drawbacks
- Environment dependency — Screenshot baselines are OS/DPR-specific. CI must use a fixed environment, and local runs may not match.
- Baseline maintenance — Intentional visual changes require updating committed baseline images.
- Threshold tuning — Anti-aliasing differences may cause flakiness; a small
maxDiffPixelRatio tolerance may be needed.
Unresolved questions
- Which CI environment to standardize on (Docker image, browser version)?
- How much tolerance (
maxDiffPixelRatio) is appropriate to avoid false positives?
- Should baselines live in the repo or be stored as CI artifacts?
Summary
Layout regressions like unwanted scrollbar appearance, element clipping, or overlay misalignment cannot be detected by interaction-based e2e tests alone. In the 3.0.4 cycle, the scrollbar regression at sheet edges was only found through manual testing. Introduce Visual Regression Testing (VRT) using Playwright's built-in
toHaveScreenshot()to catch these automatically.Reference Issues
No response
Basic Example
Append screenshot assertions to existing e2e tests to avoid additional URL accesses:
Priority targets:
CI environment should be fixed (e.g., Docker / GitHub Actions Linux) for consistent scrollbar rendering and font baselines.
Drawbacks
maxDiffPixelRatiotolerance may be needed.Unresolved questions
maxDiffPixelRatio) is appropriate to avoid false positives?