Skip to content

test(ui): no visual regression baseline for the locale x theme x viewport matrix #576

Description

@tiankaima

Problem

CI captures full-page screenshots (CAPTURE_STEP_SCREENSHOTS=1, 4 e2e shards) and publishes them to the e2e-snapshot-artifacts Pages site, but nothing ever asserts on them: tests/e2e/mobile-screenshots/screenshots.spec.ts navigates ~30 pages on mobile-chrome and never compares pixels, and there is no coverage of the locale (zh-cn/en-us) x theme (light/dark) x viewport matrix at all — locale e2e exists only via /api/locale and theme is asserted in exactly two places.

Regressions like untranslated strings, dark-mode contrast breakage, or mobile overflow ship unnoticed.

Suggested fix

  • Extend the screenshot spec to run the locale x theme matrix deterministically (NEXT_LOCALE cookie + life-ustc-theme localStorage init script).
  • Add visual comparison: either Playwright toHaveScreenshot baselines committed for a small critical subset (home, /courses, /sections/[jwId], /signin, /dashboard), or a lightweight diff job that fails on large pixel deltas against the previous published artifact set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: frontendRendered pages, client interactions, responsive layout, accessibility, and i18nenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions