-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow archiving from specified external domains #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great!
It may also be nice to add to our asset E2E test to ensure this is working. I think we could use Playwright's mock API in those tests to serve one of the test images from a fake domain, and then ensure that it is archived and loads over in Chromatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one minor suggestion but not blocking. Looks great!
🚀 PR was released in |
Issue: #CAP-1124
What Changed
Allows users to specify which external (to the site being tested) domains whose resources will be archived. This is done by specifying the
allowedArchiveDomains
value in the user'splaywright.config.js
file.I've updated the calling code from Cypress to still work, but it doesn't pass this config option through yet.
I've also inlined more of the test's expected values, both to limit how much test-specific logic we have and to make it more explicit what the test expects.
How it works
We now (internally) make note of what URL the test is being run against. We then compare URLs against our external-domain-allow-list and archive resources from the origins that match.
When archiving other-domain URLs, we prepend their file path with the host.
How to test
playwright.config.js
file, specify one of these domainsnpx playwright test
archive-storybook
Change Type
maintenance
documentation
patch
minor
major
📦 Published PR as canary version:
0.0.39--canary.37.88cfa0f.0
✨ Test out this PR locally via: