top of page
  • Seema Nair

Test Automation of React/NodeJS applications using WebDriverIO

Recently, I had the chance to learn and implement test automated scripts on a Javascript testing framework - WebDriverIO, with Mocha framework. Having used Selenium WebDriver extensively with TDD and BDD frameworks like JBehave and Java as the programming language, getting used to Javascript was a challenge.

Javascript is popularly used by developers worldwide for front-end and back-end development. The back-end of the product I was testing was built in NodeJS. So, it made more sense to use the same for the testing framework as well. It is always advantageous to build automated tests using the same language used by developers to build the product. Especially in paired testing environments were developer support will be sought to resolve automated script issues.

The first thing that you would notice about this tool is the speed at which the tests are executed. Based on my experience with other functional web testing tools like Selenium WebDriver, IBM RFT, Telerik, Sahi etc., I found WebDriverIO to be at least 5X faster in comparison.

WebDriverIO comes with a built-in test runner wdio, which can test across multiple browsers in parallel. The maximum number of parallel instances that should be launched during execution can be defined. This is a great feature, which helps you do some form of concurrent testing, in addition to functional testing, as you can launch tests on multiple browser sessions. Testers can run different specs or user stories in multiple browser sessions, which actually simulates usage of multiple users in real life trying to perform different operations on the application concurrently.

WebDriverIO was designed with the Page Object Pattern in mind. It provides inheritance between page objects. You can abstract all page information from the actual tests.

Test Results can be reported in Junit XML format or Allure Report format. Allure reports are packaged with very user friendly test reports in HTML format.

WebDriverIO provides integration with CI tool like Jenkins. As it is widely known, Jenkins provide detailed test results with history charts, stack-trace information of your test execution.

138 views0 comments


bottom of page