Skip to content
/ Watai Public
forked from MattiSG/Watai

Next-generation full-stack web testing

Notifications You must be signed in to change notification settings

gcanu/Watai

 
 

Repository files navigation

Watai

Watai (Web Application Testing Automation Infrastructure) is a declarative, bottom-up BDD, full-stack web testing framework.

It is both a test runner engine (i.e. it executes tests) and a set of architectural patterns to make you write maintainable, solid end-to-end (GUI) tests. It automatically handles asynchronous operations without any work on your side.

The tests you write will automate navigation on your webapp through actual browsers, just like an actual user would.

➥ Read more about what is Watai.

Benefits

  1. Creating a safety net to catch regressions in your webapp.
  2. Checking cross-browser consistency automatically.
  3. Defining expected behavior and testing it at user level, not in isolation as in unit tests.

➥ Read more about when and how you should use Watai.

Status

Watai is currently alpha-level software

This means that its stability and feature set can not be guaranteed. It is constantly improving, and a high level of quality control is applied to its development. But mistakes can always happen.

We are currently using Watai in a live project, and at least two other teams do so. It works well on its core feature set, but errors are not really developer-friendly at the moment, so you could get blocked on some specificities of your app.

You are highly encouraged to try out Watai and see if it fits your needs. Getting started and writing your first test should take you around 15 minutes, and the results should get you quite excited :)

If anything goes wrong, please open an issue, and I'll do my best to get you out of trouble!

Versioning

SemVer is followed to convey the state of the software through version numbers.

You can rely on the fact that the syntax you write your tests in won't change until a minor version number (the y in x.y.z) is updated.

Versions considered stable are tagged with a version number and not suffixed with -alpha. They are good fallbacks if anything goes wrong after an update.

Installing

This installation guide assumes a POSIX-compliant OS, such as Mac OS X or Linux. If you're under Windows, see the Windows installation guide.

Dependencies

Node & NPM

Watai runs as a Node.js module. You will therefore need the Node runtime (v0.6+, v0.8+) and package manager (NPM).

Download the Node+NPM package for your environment if you don't already have it.

Selenium Server

Watai uses Selenium-WebDriver to automate browsers. You will therefore need a Selenium standalone server to send commands to the browsers.

If you’re under OSX and have Homebrew:

brew install selenium-server-standalone

…and start it with the command given at the end of the “Caveats” section.

Otherwise, download the latest JAR and start it (preferably in the background):

java -jar path/to/downloaded/selenium-server-standalone.jar

This will output many INFO lines over a few seconds. You know it is done when it says:

… INFO - Started org.openqa.jetty.jetty.Server@…

You will obviously need Java (≥ 1.5). If you don’t have it yet (but you probably wouldn’t be reading this README), download it now.

Optional: ChromeDriver

If you want to test with Chrome (or with other browsers), you will have to install some additional software.

This is completely optional, and you will be operational faster if you do the tutorial with Firefox. The testing itself will be a bit slower, but you may come back to add Chrome later on if you like Watai :)

Package

Once you have both Node and a Selenium server, you can consider installing Watai itself.

Global install (easiest)

sudo npm install -g watai

NPM will automatically create the watai alias for you. If you decide you don’t want to use Watai later on, simply npm uninstall -g it.

Local install

cd choose/your/install/folder
npm install watai
alias watai="$(pwd)/node_modules/watai/go"

This will create a node_modules folder with all dependencies in the current directory. A good way to give Watai a quick look if you’re afraid of sudoing.

From behind a proxy

If your proxy configuration prevents you from using npm install properly (i.e. you get ERRTIMEOUT errors), download the latest Watai with NPM dependencies package from the Downloads tab, unzip it and:

alias watai='node path/to/unzipped/folder/src'

Mark the /src at the end!

Validation

Let’s make sure you’re fully ready to use Watai by typing:

watai --installed

License

The code for this software is distributed under an LGPL license. That means you may use it to test any type of software, be it free or proprietary. But if you make any changes to the test engine itself (i.e. this library), you have to share them back with the community. Sounds fair? :)

Contact the author if you have any specific need or question regarding licensing.

About

Next-generation full-stack web testing

Resources

Stars

Watchers

Forks

Packages

No packages published