Andrey Lushnikov 242a6a6e73 Introduce screenshot tests
This patch introduces a goldentest.js. The tests inside
the file should rely on "golden" results rather then asserts.

For now, goldentest.js allows only image expectations. If the
actual result doesn't match the expected result, the two files
are created under `test/output` folder:
- The '-actual.png' contains the actual test result
- The '-diff.png' contains the diff between images
2017-06-16 14:33:34 -07:00
2017-06-16 11:24:47 -07:00
2017-06-16 11:24:47 -07:00
2017-06-16 14:33:34 -07:00
2017-06-11 01:32:59 -07:00
2017-06-16 14:33:34 -07:00
2017-05-14 23:28:00 -07:00
2017-06-11 01:32:59 -07:00
2017-06-16 14:33:34 -07:00
2017-05-12 16:38:07 -07:00

Status

Test results on Mac OS X in headless mode:

  111 passed
   20 failed as expected
    1 skipped
   49 unsupported

Installing

npm i
npm link # this adds puppeteer to $PATH

Run

# run phantomjs script
puppeteer third_party/phantomjs/examples/colorwheel.js

# run 'headful'
puppeteer --no-headless third_party/phantomjs/examples/colorwheel.js

# run puppeteer example
node examples/screenshot.js

Tests

Run all tests:

npm test

Run phantom.js tests using puppeteer:

npm run test-phantom

Run puppeteer tests:

npm run test-puppeteer
Languages
TypeScript 93.2%
JavaScript 5.1%
HTML 1.2%
CSS 0.3%
MDX 0.1%