~/talk

Unit Testing with Screenshots: Breaking the Sound Barrier

TalkinRussianat HolyJS 2017 · on Monday, 2017-12-11· [testing, developer-experience]

An in-house screenshot testing pipeline that captures component HTML and inline CSS using Jest with a Babel transform, freezes animations and converts GIFs to static frames, and renders pages with Puppeteer headless Chrome via a microservice renderer. Image comparison uses a fast binary fallback (Buffer.compare/hash) then a custom fast PNG decode and pixel diff to reduce full-run time to ~12–15s for ~300 screenshots (tunable to ~4s), with golden images stored in the repo using git-lfs.

AI-written summary · about

  1. 0:00Introduction
  2. 2:18Screenshot testing
  3. 3:41Problems with tools
  4. 5:04Static markup generation
  5. 6:49CSS and dependencies
  6. 9:42Replacing CSS resources
  7. 12:35Disabling animations
  8. 15:24Animated GIFs
  9. 17:32Parallel test issues
  10. 19:40Final markup assembly
  11. 20:42Headless browser screenshots
  12. 22:27Cross-platform problems
  13. 23:10Microservice for screenshots
  14. 27:06Jest screenshot comparison
  15. 29:16Jest-snapshot issues
  16. 31:47Image comparison optimization
  17. 34:57Faster comparison via hashing
  18. 37:44Pixel-by-pixel diff
  19. 40:11DIV-image generation
  20. 42:58Visualizing differences
  21. 45:25Expand mode analysis
  22. 46:09Optimizing screenshots
  23. 47:34Storing code in PNG
  24. 49:02Git binary issues
  25. 51:10Git LFS for images
  26. 52:55Test runtime optimization
  27. 54:40Caching for speed
  28. 55:44Open sourcing
  29. 56:05Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.