0.0.7 • Published 7 years ago

gulp-casperjs v0.0.7

Weekly downloads
59
License
MIT
Repository
github
Last release
7 years ago

gulp-casperjs

A gulp plugin for running CasperJS scripts

Install

npm install --save-dev gulp-casperjs

Usages

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 set custom path to CasperJS use parameter binPath:

var casperJs = require('gulp-casperjs');
gulp.task('test', function () {
  gulp.src('test.js')
    .pipe(casperJs({binPath: './node_modules/casperjs/bin/casperjs'})); //custom path to CasperJs
});

Default is casperjs (global)

Options

It is possible to pass casperjs options via main options object.

var casperJs = require('gulp-casperjs');
gulp.task('casperCmd', function () {
  const options = {
    logLevel: 'debug',
    includes: 'node_modules/package/index.js,node_modules/pacakge2/index.js',
    webSecurity: 'no'
  };
  gulp.src('test.js')
    .pipe(casperJs(options)); //run casperjs test.js
});

Options are documented in official CasperJS documentation http://docs.casperjs.org Possible values are

OptionParameter NamePossible Values
concise--concise
engine--enginephantomjs | slimerjs
failFast--fail-fast
includes--includes<filename>,<filename>
logLevel--log-level[debug \| info \| warning \| error]
noColors--no-colors
post--post<filename>
pre--pre<filename>
webSecurity--web-securityno
xunit--xunit<filename>

LICENSE

The MIT License (MIT)

0.0.7

7 years ago

0.0.6

8 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago