Skip to content

fix(playwright): restore support for projects[].use.viewport - #444

Merged
AriPerkkio merged 2 commits into
mainfrom
fix/playwright-projects-viewports
Sep 25, 2026
Merged

AriPerkkio merged 2 commits into
mainfrom
fix/playwright-projects-viewports

Conversation

@AriPerkkio

@AriPerkkio AriPerkkio commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Issue:

What Changed

When user defines multiple Playwright projects that run same test files, each of them write the same test-result/chromatic-archives/<name>.stories.json file. They are overriding each others results. This is known bug that was never fixed in #258.

Before #318 it was actually possible to support viewports from multiple projects. After the test run when (build-)archive-storybook is called, the test-result/chromatic-archives/archive/ was read and each *.stories.json's parameters.viewport was rewritten again. This works only for viewports - other project level options (like colorScheme) are not respected. They work only per-snapshot.

How to test

@changeset-bot

changeset-bot Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 647d113

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chromatic-com/playwright Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@chromatic-com/cypress@647d113 -D
pnpm add https://pkg.pr.new/@chromatic-com/playwright@647d113 -D
pnpm add https://pkg.pr.new/@chromatic-com/vitest@647d113 -D

commit: 647d113

@AriPerkkio
AriPerkkio force-pushed the fix/playwright-projects-viewports branch 2 times, most recently from 600493b to c60809d Compare August 28, 2026 12:14
Comment thread packages/playwright/src/bin/set-viewports.ts Outdated
@AriPerkkio
AriPerkkio force-pushed the fix/playwright-projects-viewports branch from c60809d to 647d113 Compare September 25, 2026 07:33
@AriPerkkio
AriPerkkio marked this pull request as ready for review September 25, 2026 07:34
@AriPerkkio
AriPerkkio merged commit 84b67ad into main Sep 25, 2026
12 checks passed
@AriPerkkio
AriPerkkio deleted the fix/playwright-projects-viewports branch September 25, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playwright - Multiple viewports testing is not possible anymore

2 participants