Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect viewport set via Playwright #10

Conversation

thafryer
Copy link
Member

@thafryer thafryer commented Aug 23, 2023

Issue: #

What Changed

The generated Stories.json file now includes viewport values, which allows viewports set via Playwright to be passed to the Chromatic Capture Cloud.

How to test

  1. Set a viewport in your e2e tests via the Playwright API.
  2. Run a Build

Change Type

  • maintenance
  • documentation
  • patch
  • minor
  • major
📦 Published PR as canary version: 0.0.19--canary.10.b280b3a.0

✨ Test out this PR locally via:

npm install @chromaui/test-archiver@0.0.19--canary.10.b280b3a.0
# or 
yarn add @chromaui/test-archiver@0.0.19--canary.10.b280b3a.0

@linear
Copy link

linear bot commented Aug 23, 2023

AP-3327 Viewport in Playwright config not respected by Chromatic

// playwright.config.ts

export default defineConfig({
  use: {
    viewport: { width: 1024, height: 768 }
  }
});

Has no effect on Chromatic

@thafryer thafryer marked this pull request as ready for review August 24, 2023 18:00
Copy link
Member

@skitterm skitterm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thafryer that was fast! Will this handle both playwright viewports set at the config level and at the page level? https://playwright.dev/docs/emulation#viewport

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! We should really have tests for this write-archive/index.ts but I guess that's outside of the scope of this PR.

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! We should really have tests for this write-archive/index.ts but I guess that's outside of the scope of this PR.

@thafryer
Copy link
Member Author

Awesome! We should really have tests for this write-archive/index.ts but I guess that's outside of the scope of this PR.

@tmeasday I went ahead and added a test.

@thafryer thafryer merged commit 7732e5a into main Aug 25, 2023
2 checks passed
@thafryer thafryer deleted the jarel/ap-3327-viewport-in-playwright-config-not-respected-by-chromatic branch August 25, 2023 14:57
@tmeasday
Copy link
Member

🚀 PR was released in v0.0.19 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants