A framework to step through a website saving screenshots, based on Horseman.
In the terminal, change to Nixon directory and run:
-
npm install
-
node nixon
The example script will run , and screenshots will be saved into a 'screenshots' folder.
Make a copy of example-script.js
, for example blog.js
You can now run this script:
node nixon blog
Type: String
Where your screenshots will be saved. Supports the following tags:
- # - screenshot number (zero padded: ## outputs 01, ### outputs 001)
- script - name of the script
- size.width
- size.height
- size.crop - will output "full" or "crop" depending on the size set (see
sizes
) - step.name
For example: "screenshots/[script]/[size.width]/[#]-[step.name]"
Type: Array
The screen sizes you would like to capture. If you'd like the screenshot cropped to the set height, add "crop" as the 3rd item in the array.
For example [[800, 600], [1280, 1024, "crop"]]
.
Type: Array
An array of step objects for the script to carry out (see below).
Type: String (URL)
If the browser is not on the expectedUrl
at the end of this step, Nixon will log a warning in the console.
Type: Function
This JavaScript function will be run in the browser before the screenshot is taken.
If open
is also set, it will run before js
.
Type: String
The name of the step is used in the filename when saving screenshots.
Type: String (URL)
The browser will open the URL set here.
If js
is also set, it will run after open
.
Type: Boolean
Default: true
If this is set to false
, a screenshot won't be taken for this step.