- WebdriverIO is a good automation tool which can automate both web applications and native mobile Apps.
- It has integrated test runner which helps us to write asynchronous commands in a synchronous way so that we don’t need to care about how to handle a Promise to avoid racing conditions.
- It has 'wdio setup wizard' which makes our project setup very easy.
- The test runner also comes with a variety of hooks that allow us to interfere into the test process in order to e.g. take screenshots if an error occurs or modify the test procedure according to a previous test result.
- WebdriverIO services will be helpful to integrate our test to third party tools like 'Appium'.
To install webdriverIO, you will need node to be installed in your system. Please go through below mentioned post to install it.
- Setup your project Before installing dependencies, we will need to initialize a new NPM project. This will allow us to use the CLI to install dependencies in your project.
$ mkdir webdriverio-test && cd webdriverio-test $ npm init -y
The -y will answer 'yes' to all the prompts, giving you a standard NPM project. Feel free to omit the -y if you'd like to specify your own project details.
- Install WebdriverIO CLI
$ npm i --save-dev @wdio/cli
- Generate configuration file Next, we will generate a configuration file to store our WebdriverIO settings.
To do that, just run the configuration utility:
$ npx wdio config -y
That's it! The configurator will install all required packages for you and create a config file called wdio.conf.js.
Thanks for reading. Please share your thoughts.