Code Monkey home page Code Monkey logo

nightwatch-boilerplate's Introduction

nightwatch-boilerplate

boilerplate for nightwatch.js with selenium

Original Framework is from https://github.com/nightwatchjs/nightwatch and also from https://github.com/mucsi96/nightwatch-cucumber

I created a Boilerplate for nightwatch to use with and also without nightwatch-cucumber.

Install Nightwatch Boilerplate

First you need to install Node.js (https://nodejs.org/en/) and Java.

Then...

$ git clone https://github.com/christinezierold27/nightwatch-boilerplate.git
$ cd nightwatch-boilerplate
$ npm install

Run Tests

In this boilerplate you find one test which does a simple GUI Test in Google. The configuration is set up (nightwatch.conf.js) that the selenium server is started with the test and you do not have to start the server manuelly. The test is saved under tests/src/ and also as a cucumber version under features/group .

to start plain Nightwatch test (tests/src/)

$ cd nightwatch-boilerplate
$ npm start

to start cucumber Nightwatch test (features/group)

$ cd nightwatch-boilerplate
$ npm start:cucumber

Console Output

reports

for cucumber

under features\reports will be a HTML Report created after each cucumber test run.

HTML Report

configuration

There are two config files in this project. One in the main folder (nightwatch.conf.js) for all the general configurations and one under tests/nightwatch.conf.js for the specific configuration for the plain nightwatch tests.

to set up the default starting browser

open nightwatch.conf.js in the main folder

under test_settings --> default --> desiredCapabilities --> browserName you can change the value to chrome or firefox to change the browser

to set up that the selenium server starts with tests

open nightwatch.conf.js in the main folder

under selenium --> start_process set the value of TRUE to set up that the selenium server starts with the test

Use Docker

In the docker-compose.yml are one Selenium Hub (2.53.1) and two nodes (chrome and firefox) configured. The Images are from https://github.com/SeleniumHQ/docker-selenium

To start/build the Docker containers run this:

$ docker-compose up -d

After that the containers for the Grid and Nodes are build and ready to use.

usage under Windows 7

If you use Windows 7 you may have to change the value for server_path for the selenium server because Windows7 uses docker-machine and that's why the selenium server container is not reachable via the service name 'seleniumhub'. You find this setting in the nightwatch.cong.js:

selenium : {
        server_path : dockerSeleniumHub
        ...

nightwatch-boilerplate's People

Contributors

christine-pinto avatar

Watchers

James Cloos avatar

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.