Hide app version from Argos snapshots#2441
Conversation
The version string (e.g. v2024-12-12-3073dd1c) is a per-build value rendered in the sidebar footer, causing Argos visual-regression snapshots to churn on every build (notably the e2e-project-view-* snapshots, which boot a real FwLiteWeb binary with a live version). Tag the version <div> with data-testid="app-version" and inject argosCSS in the shared screenshot helper to hide it (visibility:hidden so layout is preserved). Applied to defaultOptions so it covers both the UI and E2E suites and any future snapshot. Test-side only; no backend or runtime-app changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughWalkthroughChangesApp Version Stability
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Playwright's `screenshot: 'on'` takes an end-of-test screenshot that the Argos reporter uploads under the test title (e.g. "Project download: log in, download, and open the project.png"). These bypass the argos-screenshot helper, so its argosCSS version-masking never applies and they churn on the per-build app version. They also just duplicate the controlled e2e-* snapshots the tests already take with masking, adding no coverage. Switch to `screenshot: 'only-on-failure'` so passing runs no longer produce (and upload) these redundant, version-churning captures. `trace: 'on'` still provides full step-by-step debugging, and failure screenshots are retained. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@myieye notice we disabled some cases where we had screenshots, I think they were redundant anyway? |
myieye
left a comment
There was a problem hiding this comment.
Looks good.
Yeah, I recently convinced you that only-on-failure was a tad better, but if it evades the argos fix that's an excellent reason to revert it. We should be explicitly taking screenshots of the things we want anyway.
Argos visual-regression snapshots (added in #1866) fail on every build because they capture the FW Lite version string in the sidebar footer — a per-build value like
v2024-12-12-3073dd1c. Thee2e-project-view-*snapshots are worst hit, since the E2E suite boots a realFwLiteWebbinary with a live version.This hides the version during capture only, so both the E2E and UI suites stay stable.
What changed
ProjectSidebar.svelte— addeddata-testid="app-version"to the version<div>as a stable selector hook.tests/helpers/argos-screenshot.ts— addedargosCSS: '[data-testid="app-version"] { visibility: hidden; }'todefaultOptions.argosCSSis injected only during the screenshot;visibility: hiddenpreserves layout so surrounding elements don't shift. Placing it indefaultOptionscovers both suites and any future snapshot through the shared helper.tests/e2e/playwright.config.ts— changeduse.screenshotfrom'on'to'only-on-failure'. Playwright's automatic end-of-test screenshot was being uploaded to Argos by the reporter under the test title (e.g.Project download: log in, download, and open the project.png), bypassing theargos-screenshothelper — soargosCSSnever masked it and it still churned on the version. Those automatic captures also just duplicate the controllede2e-*snapshots the tests already take, so they're dropped on passing runs.trace: 'on'still provides full step-by-step debugging, and failure screenshots are retained.Test-side only — no backend or runtime-app changes.
Test plan
pnpm run lint— clean.task test:ui-standalone -- project-view— all 4 snapshot tests pass; screenshots generated.project-view-default-lightscreenshot: the version line above "Made with ❤️" is blank and the footer sits at the same height (layout preserved).e2e-project-view-*snapshots can't run locally (need a kind cluster) — relying on CI.Reviewer note
This produces a one-time set of expected Argos diffs to approve; after that both suites are stable.
devversion), so its baselines change once: the version line goes blank at the same footer height (4 changed).e2e-project-view-*snapshots go version-blank (4 changed), and the two redundant automatic screenshots (Project download… .pngand the smoke test's) are removed (2 removed).🤖 Generated with Claude Code