grunt-slimer-screenshot
Save screenshots of any page using SlimerJS
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-slimer-screenshot --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
SlimerJS
The module uses SlimerJS for taking screenshots. If you have troubles with SlimerJS, refer to the project documentation page SlimerJS documentation.
Troubleshooting
The "slimer_screenshot" task
- 2016-02-01: (for version < 0.2.0)There seems to be a problem with the SlimerJS node package. Getting version 0.9.6
npm install -g slimerjs@0.9.6
seem to fix the problem. - 2017-01-03: Fix for
Cannot find mobule 'slimerjs'
: https://github.com/laurentj/slimerjs/pull/565/files (fixed with slimerjs 0.10.3 and grunt-slimer-screenshot 0.2.0) - 2017-01-03: Fix for
SLIMERJSLAUNCHER environment variable does not contain an executable path
: https://docs.slimerjs.org/current/installation.html
Overview
In your project's Gruntfile, add a section named slimer_screenshot
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.width
Type: Number
Default value: 1024
SlimerJS viewport width.
options.height
Type: Number
Default value: 768
SlimerJS viewport height.
options.savingDir
Type: String
Default value: ./
Folder where screenshots are saved.
options.delay
Type: Number
Default value: 0
Delay before taking screenshot.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
- 2016-06-16 v0.1.4 Initial version
- 2017-03-27 v0.2.0 Use of the SlimerJS package (0.10.3) as a dependency
- 2017-03-28 v0.2.1 Readme update
- 2018-06-13 v0.3.0 Upgraded to SlimerJS v1.0.0 - removed usage of XVFB for headless execution - use instead
--headless
for SlimerJS (available starting FF 56)