1. gulp-nightwatch
gulp plugin for Nightwatch.js
gulp-nightwatch
Package: gulp-nightwatch
Created by: tatsuyafw
Last modified: Sat, 18 Jun 2022 17:36:56 GMT
Version: 1.2.0
License: MIT
Downloads: 1,636
Repository: https://github.com/tatsuyafw/gulp-nightwatch

Install

npm install gulp-nightwatch
yarn add gulp-nightwatch

gulp-nightwatch NPM version Build Status

Usage

First, install gulp-nightwatch as a development dependency:

 npm install --save-dev gulp-nightwatch

Then, write your gulpfile.js as below.

 var gulp = require('gulp'),
    nightwatch = require('gulp-nightwatch');

gulp.task('default', function() {
  return gulp.src('gulpfile.js')
    .pipe(nightwatch({
      configFile: 'test/nightwatch.json'
    }));
});

You can pass command line options to Nightwatch as an array by using the option cliArgs.

 gulp.task('nightwatch:chrome', function(){
  return gulp.src('gulpfile.js')
    .pipe(nightwatch({
      configFile: 'test/nightwatch.json',
      cliArgs: [ '--env chrome', '--tag sandbox' ]
    }));
});

You may use an object instead, if you prefer.

 gulp.task('nightwatch:chrome', function(){
  return gulp.src('gulpfile.js')
    .pipe(nightwatch({
      configFile: 'test/nightwatch.json',
      cliArgs: {
        env: 'chrome',
        tag: 'sandbox'
      }
    }));
});

API

nightwatch(options)

options

configFile

Type: String
Default: nightwatch.json

The path to your Nightwatch config

cliArgs

Type: Array or Object
Default: null

Command line options for Nightwatch

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code