A gulp plugin for running CasperJS scripts
npm install --save-dev gulp-casperjs
var casperJs = require('gulp-casperjs');
gulp.task('test', function () {
gulp.src('Globs of test files')
.pipe(casperJs()); //run casperjs test
});
To change the command (default: test
) use parameter command
:
var casperJs = require('gulp-casperjs');
gulp.task('casperCmd', function () {
gulp.src('test.js')
.pipe(casperJs({command:''})); //run casperjs test.js
});
Command can be array
or string
.
If command has value which cast to false
, this parameter will be ignored.
To hide output from CasperJS use parameter outputLog
:
var casperJs = require('gulp-casperjs');
gulp.task('casperCmd', function () {
gulp.src('test.js')
.pipe(casperJs({outputLog: false})); //CasperJS output not show
});
Default value is true
The MIT License (MIT)