feat: add assertScreenshot command#126
Conversation
|
Thanks @kacperzolkiewski — this is a genuinely well-built PR, and A few things I appreciated on review:
I built it and ran the touched-package suites locally — green — and the default threshold (95% when unset) is sensible. One thing I'd like to see before merging — baseline creationRight now a missing reference image hard-fails ( Most visual-regression tools (Playwright's Even the simplest version — when the reference is absent, write the captured screenshot as the new baseline and pass — turns the workflow from "fail, then go hunt for the file" into "run once to seed, then assert." A flag-gated update mode for intentional re-baselining would be a nice bonus. Two smaller notes (non-blocking)
Really appreciate the contribution — and thanks for the kind words (and the 3× speedup data point 🙂). Happy to help if you want a hand wiring up the baseline-create path. |
|
Hi @omnarayan, I've added automatic baseline creation and updated the documentation accordingly. |
Summary
Hi,
First of all, thank you for all your work on this library!
I'm a maintainer of react-native-enriched-html, and I'd like to use your library for our E2E tests. This PR adds an
assertScreenshotcommand, which is the main feature we were missing to be able to migrate our tests.I created this feature with the help of AI, so I'd really appreciate it if you could review it and let me know if there are any changes you'd recommend.
I also added support for generating a

__diff.pngfile wheneverassertScreenshotfails. The diff image highlights the differences with red rectangles, making it much easier to identify what changed:I've been running our Android E2E tests using the DeviceLab driver, and I noticed they're about three times faster than when running the same tests with Maestro.
Thanks in advance for taking a look!
Type of Change
Changes Made
Related Issues
n/a
Testing
make test)make lint)Checklist
Additional Notes