-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add visual diffing proof-of-concept. #7382
Conversation
- Add scripts/compareScreenshots.js. - Add gm dependency. - Temporarily introduce error to app-link. - Rename test/output to test/screenshots.
fa30211
to
fe817a8
Compare
FYI, I tried installing gm, imagemagick, and graphicsmagick all with npm on Windows in a gitbash shell. gm and imagemagick appear to have worked.
So I installed grapicsmagick Q8 64 bit for Windows from here; I thought the session screenshots would be saved in my kibana/test/session but they're going to C:\screenshots\session When I try to run
And when I open compareScreenshots in my editor is shows |
OK, I've tried getting this to work on my Windows VM but developing in the VM is too painful and slow. After discussion with @ycombinator, @panda01, and @LeeDr, I'm going to close this and:
Pinging @bevacqua to keep him looped in! |
Have you looked at options to do stuff like this? There's several. Some: |
@bevacqua Nice! Thanks! I think Pageres is too closely coupled to the screenshot-capture process but image-diff looks like it might be perfect for our use case. I'll take a closer look before moving forward with a custom tool. |
There's also https://github.com/Huddle/Resemble.js, which I thought @LeeDr played around with before? |
@Bargs Resemble is a bust, since its node port has fell out of regular mainteance. 😞 @bevacqua We have a winner with image-diff, though! This library is exactly what I would have liked to write. It has a fundamentally identical implementation to what I've done in this branch, the output is exactly the same, and it already presents the interface I would like to use. Moving forward with this one. Great suggestion! |
Changes
Goal
During CSS refactors, we can use this tool to make sure we haven't introduced any CSS regressions.
How to test
brew install imagemagick
andbrew install graphicsmagick
).gm
devDependency withnpm i
.test/screenshots/session
.node scripts/compareScreenshots
, which will traverse the recently captured screenshots, compare them against those committed intest/screenshots/baseline
and output image diffs totest/screenshots/diff
.Then you can look at the generated diff images to see if anything has dramatically changed (i.e. broken). In this proof-of-concept, you'll see the change introduced in
app_switcher.less
surfaced in the diffs.Looking ahead
The next steps with this tool can be: