Taking the first step You’ll need Node.js installed.
Only releases that are or will become an LTS release are officially supported If you don't have Node installed, we recommend installing NVM to assist managing multiple active Node.js versions.
Before installing dependencies, you’ll need to initialize a new NPM project. This will allow you to use the CLI to install dependencies in your project.
#To do this, run:
$ 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.
If you want to use WebdriverIO in your project for integration testing, we recommend using the test runner. It comes with lots of useful features that makes your life easier. Since WebdriverIO version 5, the testrunner is in the @wdio/cli NPM package.
$ npm i --save-dev @wdio/cli
Generate Configuration File Next, you’ll generate a configuration file to store your 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.
$ npx wdio wdio.conf.js
Hurray! The test should pass, and you can start writing integration tests with WebdriverIO.