GithubHelp home page GithubHelp logo

nightwatchtest's Introduction

NightWatchTest

Test automation framework for End to End UI Test testing using NodeJS, Nightwatch, Typescript, Selenium for testing locally and Sauce Labs.

##Prerequisites

To proceed you need a Mac, Windows, or Linux machine, and:

  1. node installed. (4.* LTS release)

  2. npm installed (usually installed along with node). After installing nodejs, the version shipped by nodejs for 4.* LTS release is very old and needs to be upgraded to the latest version (3.*). To install npm

        npm install npm -g
    
  3. If tests are to be executed on Sauce Labs, Sauce labs Username and API Key for the user

  4. Copy of this repository using Git or from a browser

        git clone https://github.com/rkavalap/NightWatchTest 
        or 
        https://github.com/rkavalap/NightWatchTest/archive/master.zip
    
  5. From the copy of the source i.e NightWatchTest directory

        npm install
    

    Install's all the dependent packages for this project under node_modules folder.

##To clean & compile source:

    npm run build

##To Execute Test:

To execute individual test suite (single file of test cases) use the "-t" argument and path of the test case under build output folder and "--env" argument.

    node node_modules/nightwatch/bin/runner.js -t buildOutput/javascript1.js --env devtest-chrome-win8

To execute multiple test cases you can use --tag argument to nightwatch. Each test suite needs to have tag attribute defined.

##Configs

There are two kinds of environment/configs in this project:

  1. The default config is defined in defaults.json5, which all other configs inherit from.
  2. Dynamically configurations are generated by combining each of the top-level objects in capabilities.json5 and deployments.json5.

###Config Merging

When nightwatch starts, it's passed configuration that is gathered or generated by nightwatch.conf.js. The generation does these things:

  1. Loads defaults.json5, which contains the base configuration.
  2. Generates what nightwatch refers to as an "environment" (a configuration object within test_settings), for each combination of objects in capabilities.json5 and deployments.json5. The generated environments are like devtest-chrome-win8.
    • deployments are things like devtest or CI. Configs here are available to all generated environments with the same deployment (i.e. devtest-chrome-win8 but not ci-chrome-win8).
    • capabilities are selenium settings (i.e. the -chrome-win8 part). Configs here are available to all generated environments with the same capability (i.e. devtest-chrome-win8 and ci-chrome-win8, but not devtest-ie10-win7).
  3. Loads any settings in configs/, and applies them also as environments under test_settings.

##Project source Layout:

  • tests - Contains all the UI test scripts.
  • globalsmodule.js - Nightwatch globals module file
  • gulpfile.js - Build file (compilation from ts to js using Gulp)
  • nightwatch.conf.js - config file for nightwatch
  • package.json - dependent nodejs packages used for this project installed under node_modules directory
  • typings - Created on execution of build. Provides intellisense support for Nightwatch framework.

##Intellisense

VS Code

Experience should be similar to Visual studio and other IDE's supporting Typescript Intellisense.

##References

nightwatchtest's People

Contributors

dependabot[bot] avatar rkavalap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nightwatchtest's Issues

Contribute type definitions to Typings!?

Hey there,

Been looking for type script definitions for Nightwatch for ages. Thank you.

Would you be so kind as to contribute it to typings? They have a public repository here which acts as a register for all public type definitions.

Cheers!!

found 11 vulnerabilities. 1 moderate, 6 high, 1 critical.

Downloaded this & ran npm install.

Got the following messages:

found 11 vulnerabilities (3 low, 1 moderate, 6 high, 1 critical)

result from npm audit:

=== npm audit security report ===

Run npm install [email protected] to resolve 5 vulnerabilities

SEMVER WARNING: Recommended action is a potentially breaking change

High Regular Expression Denial of Service

Package minimatch

Dependency of nightwatch

Path nightwatch > minimatch

More info https://nodesecurity.io/advisories/118

High Regular Expression Denial of Service

Package minimatch

Dependency of nightwatch

Path nightwatch > mocha-nightwatch > glob > minimatch

More info https://nodesecurity.io/advisories/118

Low Regular Expression Denial of Service

Package debug

Dependency of nightwatch

Path nightwatch > mocha-nightwatch > debug

More info https://nodesecurity.io/advisories/534

Moderate Regular Expression Denial of Service

Package ms

Dependency of nightwatch

Path nightwatch > mocha-nightwatch > debug > ms

More info https://nodesecurity.io/advisories/46

Critical Command Injection

Package growl

Dependency of nightwatch

Path nightwatch > mocha-nightwatch > growl

More info https://nodesecurity.io/advisories/146

Run npm install [email protected] to resolve 5 vulnerabilities

SEMVER WARNING: Recommended action is a potentially breaking change

High Regular Expression Denial of Service

Package minimatch

Dependency of gulp

Path gulp > vinyl-fs > glob-watcher > gaze > globule > glob >
minimatch

More info https://nodesecurity.io/advisories/118

High Regular Expression Denial of Service

Package minimatch

Dependency of gulp

Path gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch

More info https://nodesecurity.io/advisories/118

High Regular Expression Denial of Service

Package minimatch

Dependency of gulp

Path gulp > vinyl-fs > glob-stream > glob > minimatch

More info https://nodesecurity.io/advisories/118

High Regular Expression Denial of Service

Package minimatch

Dependency of gulp

Path gulp > vinyl-fs > glob-stream > minimatch

More info https://nodesecurity.io/advisories/118

Low Prototype Pollution

Package lodash

Dependency of gulp

Path gulp > vinyl-fs > glob-watcher > gaze > globule > lodash

More info https://nodesecurity.io/advisories/577

Run npm install [email protected] to resolve 1 vulnerability

SEMVER WARNING: Recommended action is a potentially breaking change

Low Prototype Pollution

Package lodash

Dependency of lodash

Path lodash

More info https://nodesecurity.io/advisories/577

found 11 vulnerabilities (3 low, 1 moderate, 6 high, 1 critical) in 1925 scanned packages
11 vulnerabilities require semver-major dependency updates.

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.