Repository navigation
feat(vitest): name captures per browser when running several browsers - #425
Merged
Merged
Conversation
gregberge
force-pushed
the
claude/reverent-noyce-20fdc4
branch
from
November 17, 2026 14:53
b5d1b6d to
71f7600
Compare
Every browser of `browser.instances` runs the same tests and writes to the same `root`, so the last browser overwrote the screenshots and snapshots of the others. Outside Chromium, names and `baseName`s now end with ` browser-[<name>]`, before the ` vw-<width>` viewport suffix: - `button` (Chromium, unchanged) - `button browser-[firefox]` - `resp browser-[webkit] vw-320` The browser comes from `ctx.project.config.browser.name`, since each instance is a project of its own. The rule is `getBrowserSuffix` in `@argos-ci/util`, shared with `@argos-ci/storybook`. Auto-generated names reserve room for the suffix, so long Chromium names keep their length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitest runs each browser of `browser.instances` as a project of its own and calls `configureVitest` for each, so `uploadToArgos` added one reporter, and uploaded the whole root once, per browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gregberge
force-pushed
the
claude/reverent-noyce-20fdc4
branch
from
November 17, 2026 15:10
71f7600 to
66c7724
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #423 (ARG-517), for
@argos-ci/vitest. It fixes the same two problems when Vitest browser mode runs severalbrowser.instances.Naming
Every instance runs the same tests and writes to the same
root, so the last browser overwrote the screenshots and snapshots of the others. Outside Chromium, names now end withbrowser-[<name>], the same rule as Storybook:button(Chromium, unchanged)button browser-[firefox]resp browser-[webkit] vw-320(withviewports)Where the browser comes from:
ctx.project.config.browser.nameon the Node side of both commands. Each instance is a project of its own.Shared rule: it uses
getBrowserSuffixfrom@argos-ci/util, which feat(storybook): name screenshots per browser when running several browsers #423 added, so both SDKs share one definition.Order with the viewport: the browser comes first, the viewport last.
vw-<width>is always added last bygetScreenshotName, as in the Playwright SDK, so this order holds in every code path. It also groups a browser's viewports together.baseName: suffixed the same way. On Firefox,baseName: "button"points tobutton browser-[firefox], and tobutton browser-[firefox] vw-320for a viewport.argosSnapshotgets the suffix too:Auto-generated names: the browser side reserves room for the suffix when it shortens long names. It reads the browser from
server.browserinvitest/browser, which is the same config value. The space is only reserved outside Chromium, so even very long Chromium names don't change.Single upload with several browsers
Vitest calls the plugin's
configureVitestonce per instance project, souploadToArgosadded oneArgosReporterper browser, and each one uploaded the whole root. The plugin now creates its reporter once and adds it only ifreportersdoesn't already include it. This is a separatefixcommit.Type of changes
enhancement, plus abugfix for the duplicate upload.Checklist
Optional checks:
Further comments
Checked locally with a temporary config (not committed):
instances: [chromium, firefox, webkit],uploadToArgos: trueand noARGOS_TOKEN. The test took an explicit screenshot, one withviewportsandbaseName, an auto-named one, and anargosSnapshot:button.png,button browser-[firefox].png,button browser-[webkit].png. The Firefox baseline ofresp browser-[firefox] vw-320isbutton browser-[firefox] vw-320.png.I didn't run the "before" case with this config. The overwrite and the reporter per browser come from reading the code, and match what #423 measured for Storybook.
The existing Chromium e2e tests still pass, and the CI Argos builds keep their names.
Known limits:
chromiumplain. A WebdriverIOchromeinstance would getbrowser-[chrome]. Screenshots need the Playwright provider anyway, butargosSnapshotcould run there.The Vitest docs need a note on per-browser names once this is released.
🤖 Generated with Claude Code