Nightwatch.js

End-to-End (E2E) Testing

Fernando Montoya

@montogeek

 

Testing

  • Find bugs
  • Validation & verification
  • Business requirements
  • Technical requirements

Unit Testing

  • Smallest unit (method/function)

  • Expected output against given input

  • Simple as possible

  • Reliable

  • Works in isolation

Integration Testing

  • Whole system
  • Between components/modules
  • Data flow among them are happening properly

E2E Testing

  • Web browser
  • As and end user
  • Complete system

Workflow

  • Define user scenarios
  • Automate scenarios
  • Test locally
  • Test in CI

Features

  • Clean syntax
  • Great documentation
  • CSS & XPath support
  • Cloud integration
  • CI integration
  • Custom commands support

Installation

npm i -g nightwatch

Selenium Server

java -jar selenium-server-standalone-2.45.0.jar -Dwebdriver.chrome.driver=chromedriver
        

Getting started

  • nightwatch.json
  • tests
    • test.js
nightwatch -c nightwatch.json
nightwatch -c nightwatch.json 
           --test testsuite.js

Resources

Nighwatch.js

By Fernando Montoya

Nighwatch.js

End to end testing with NightWatch.js

  • 402
Loading comments...

More from Fernando Montoya