Skip to content

Instantly share code, notes, and snippets.

@twolfson
Created November 25, 2013 09:59
Show Gist options
  • Save twolfson/7639068 to your computer and use it in GitHub Desktop.
Save twolfson/7639068 to your computer and use it in GitHub Desktop.
Screenshot system thoughts

These are transcribed from notes a while back:

PhantomCanvas - Promise (ew) based system for using phantomjs as a canvas or maybe provide array of commands that we serialize


Can we do the image diff in phantomjs? Removes 1 dependency.


Screenshot infra:

  • screenshot.js, bin/lib for screenshotting a website via phantomjs
    • might exist as a node module already
      • will need that JS + --page-loaded eval
  • lib that screenshots a given URL using screenshot.js?
  • bin/lib that generates a diff of 2 images even at diff sizes or null

Screenshot infra cont:

  • lib that takes an array of params for screenshots, orig file dir, new file dir, diff file dir, and calls back with array object array of objects of files (same as input)
    • passing/not passing
{
  result: [{
    url:
    viewport:
    origFile:
    newFile:
    diffFile:
    matchDiff:
  }]
}
  • test framework renders YAML/JS files for this

  • v2 will use different low level modules for multiple browsers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment