GithubHelp home page GithubHelp logo

jahed / night-patrol Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 1.0 1.35 MB

Interactive Test Tunner for Nightwatch. Run individual tests, re-run failures, switch environments, autocompletion, and more.

License: MIT License

JavaScript 1.00% TypeScript 99.00%
nightwatch vorpal test-runner night-patrol nightwatch-configuration

night-patrol's Introduction

Night Patrol

npm

An Interactive Test Runner for Nightwatch.

Demonstration

Installation

You can install Night Patrol like any other dev dependency. Depending on if you use Yarn or NPM as your package manager, the command may vary.

yarn add --dev night-patrol
npm install --save-dev night-patrol

Usage

To start a Night Patrol session, run:

yarn night-patrol
npx night-patrol

For help, just run the help command in the Night Patrol session.

Choose the Nightwatch Configuration

By default, Night Patrol will look for a nightwatch.config.js in the current directory. You can use a different path by using the --config argument.

night-patrol --config [path to nightwatch.config.js]

Choose the Nightwatch Executable

By default, Night Patrol will use the Nightwatch executable under ./node_modules/.bin/nightwatch. If you want to use a different executable, use the --nightwatch argument.

night-patrol --nightwatch [path to nightwatch executable]

Choose the Launch Environment

By default, Night Patrol will use the default environment. If you want to use a different environment, use the --env argument.

If the given environment is not found, Night Patrol will default to the first environment under test_settings in your Nightwatch configuration.

night-patrol --env [environment key from test_settings]

License

MIT.

night-patrol's People

Contributors

jahed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

delfin86

night-patrol's Issues

Switch to TypeScript

The Babel dependencies are out of date after Babel 7 was released and no longer follow best practices like using preset-env. Also eslint is out of date and I prefer standard-js's simplicity.

Instead of upgrading Babel and eslint, this is a good opportunity to move the project over to TypeScript.

Multiple src directories are not supported

Nightwatch supports setting src_folders to an array, but Night Patrol assumes it's always string.

suitesRoot: Path.resolve(config.src_folders),

$ night-patrol --config ./tests/nightwatch.config.js
path.js:39
    throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at assertPath (path.js:39:11)
    at Object.resolve (path.js:1088:7)
    at setNightwatchConfig (/home/jahed/repos/frontiernav/frontiernav/node_modules/night-patrol/dist/actions/nightwatch.js:73:40)
    at Object.<anonymous> (/home/jahed/repos/frontiernav/frontiernav/node_modules/night-patrol/dist/cli.js:208:46)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)

Watch for changes and reload

Currently, Night Patrol loads the configuration only on start up. This means changes to the test suite (new/removed test files, new/removed test cases, changes nightwatch config, etc.) aren't loaded in and requires the user to manually restart the executable. This is inconvenient. Ideally, watch for changes and reload the configuration whenever a change is detected.

To be safe and to keep it simple, any change should reload the entire configuration, not just parts of it, unless if this introduces performance issues.

Changes which should trigger a reload:

  • Changes to nightwatch config
  • Changes to any directory and children referenced by nightwatch config which is used by Night Patrol (just src_folders for now)
  • Changes to nightwatch executable (version check)

Remove Vorpal.js dependency

Vorpal.js is barely maintained and has out of date dependencies, some with security alerts (though it's mitigated by using more recent versions in night-patrol since they're caret versions).

Vorpal is just a layer over Inquirer so it can switch to that with some work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.