Functional/Browser (End-to-End) Testing Tools
Functional Testing is the same as end-to-end testing (E2E) or browser testing. This is defined as testing the complete functionality of an application. As it relates to web applications, this would involve the use of automation tools which would mimic the user’s interaction with a web browser.
So let’s say for example, the user is asked to click an url which takes them to a website where they would register for a free coupon. Functional testing would test if the following actions are carried out once the user clicks the link:
- the browser opens to a web page
- user enters their information in each text box
- a message of confirmation or failure in attempting to register
There are various tools that are used to achieve functional testing. The table below presents four (4) different tools.
Nightwatch | Karma | Webdriver.io | Casper | |
---|---|---|---|---|
Built-in test runner | ||||
Cloud Services Support | ||||
Continuous Integration Support | * | |||
Extensible | ||||
Supports Headless Testing | ||||
Utilizes Selenium Web Driver Api | ||||
Utilizes Phantomjs | ||||
Comprehensive Documentation | ||||
Open Source |
* Casper is only able to export test results in a test suite to a XUnit XML file. There doesn’t seem to be any direct integration with a continuous integration tool, at least not yet.
Here is a brief overview of the four (4) tools used to do functional/browser testing.
Nightwatch
- An automated testing framework for web applications and websites.
- Written in Node js and utilizes the Selenium Webdriver Api, specifically the WebDriver Wire Protocol, to carry out browser related tasks similar to a user’s interaction with a browser.
- Supports CSS and Xpath selectors to find elements on a page.
- Facilitates the use of page objects.
- Custom assertions and commands are allowed.
- Has unit testing capabilities, although not as feature-rich as other tools built for this. Equipped with its own BDD assertion-style based on Chai when performing assertions.
- Third party integration with Cucumber.
Visit the official site for more information. Nightwatch
KarmaJs
- A test runner for JavaScript that runs on Node.js.
- Well suited to test AngularJs projects but can be used for other Javascript projects.
- Allows testing on any browser in addition to real devices such as tablets and phones.
- Facilitates the use of Phantom headless WebKit browser.
- A workflow can be controlled from the command line or from an IDE such as WebStorm.
- Continuous integration with frameworks such as Jenkins, Travis and Semaphore.
- Makes use of several test reporters such as progress reporter and dots reporter (for those running Travis). Other reporters are available as plugins such as growl, Junit, Teamcity and Coverage). The coverage reporter used in Karma is Instanbul.
Visit the official site for more information. Karma
Webdriver.io
- An open source testing utility for node js.
- Now has its own test runner called ‘wdio’. It has a helper utility that allows for your configuration file to be generated.
- Works with any testing framework or assertion library.
- Provides plugins for gulp, grunt and a sublime text plugin for autocompletion.
- Allows visual regression tests using Webdriver CSS
- Simple and concise syntax compared to selenium-webdriverjs and WD.js.
- Facilitates the use of page objects.
Visit the official site for more information. Webdriver.io
- A command line utility that runs Javascript in the Phantom Js execution environment.
- Facilitates the execution of Javascript in the Phantomjs headless Webkit browser and Slimerjs(Gecko).
- Easily integrates with other web applications and can be built with other libraries.
- Has its own rendering engine which allows for screenshots to be taken when conducting unit tests without opening a browser. This is done from the command-line. These screenshots help in the debugging process to visualize what’s going on in the browser.
- Asynchronous in nature due to its
then
statements. These statements add navigations step in a stack. These steps include either waiting for a previous step to be executed or waiting for a requested url or page to load. Here’s an example. - Performs the following testing areas:
CasperJs
Visit the official site for more information. Casper