0.3.0 • Published 6 years ago

@bouzuya/screenshot-testing v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

screenshot-testing-js

A screenshot testing tool for JavaScript (Node.js).

Installation

npm install @bouzuya/screenshot-testing

Usage

import { execute } from '@bouzuya/screenshot-testing';

const command = process.argv[2]; // 'approve' or 'capture' or 'compare' or 'test'
const options = {
  path: {
    approved: 'approved/',
    captured: 'captured/',
    compared: 'compared/'
  },
  scenarios: [
    {
      action: async (page) => {
        await page.goto('http://example.com');
        return {};
      },
      name: 'scenario1'
    }
  ]
};
execute(command, options);

License

MIT

Author

bouzuya <m@bouzuya.net> (http://bouzuya.net)