WebdriverIO is a Node.js based system, so the first thing you need to do is install Node (if you do not have it installed already). Go to https://nodejs.org/en/ and follow the instructions or install it using a version manager such as NVM https://github.com/nvm-sh/nvm.
The installation instructions for WebDriverIO can be found here https://webdriver.io/docs/gettingstarted/
First set up a new folder for writing tests in. In the example below we will call it wdio-vitaq (you can name it what you like).
From inside that folder initialise a new NPM project
That will create a package.json file that is used for saving dependencies.
Now you can install the WDIO CLI ("Command Line Interface")
To get started as quickly as possible we are not going to install Selenium or Appium. We are going to show you how to test a web App in a Chrome Browser using the ChromeDriver.
To setup WebdriverIO with the base configuration, run:
You will also need to edit the default wdio.conf.js file that was automatically created in this directory to define the framework to use as vitaq-mocha, add in the vitaqai service and set the test Specs to be grouped.
The definition of the specs in the WDIO config file has been extended so that it can now accept arrays within the specs array. All of the files within an inner array [['VitaqAI Spec action .js files here']] are grouped together and run in the same instance.
We suggest you keep your Vitaq WebdriverIO Spec Action scripts in a directory called actions underneath the WebdriverIO test directory. So then you configure your wdio.conf.js with:
Vitaq only supports the modified version of the Mocha framework, so you need to define this framework here:
To add in the vitaqai service you need to modify your wdio.conf.js with:
This flow diagram provides a high-level view of the steps needed to create your first Test Activity with Vitaq AI to auto-generate tests with webDriverIO.
Go to https://vitaq.online and click on the Login button. Complete login with your provided username and password. Create a Project by completing the project Name field and clicking Submit. Click on your created Project and then click on Create Test Activity. Complete the Test Activity name field and then click on Submit. Click on your created Test Activity Name and the Vitaq AI Test Activity editor will launch.
You will notice that your account is preloaded with the onBoarding project which contains the swaglabs Test Activity. We will use this to show you how to run your first end-to-end tests with Vitaq AI.
In the directory you created for writing tests (in which we recommended you call wdio-vitaq above) you can run your Test Activity by using the 'run' command and pointing to the WebdriverIO config that you just created.
Now you can run the swaglabs Test Activity listed in testActivityName in the config file.
To run the Test Activity using the AI-driven capability, where Vitaq will "machine-learn" what next allowable tests it needs to auto-generate to reach 100% test coverage use these options.
Once completed, you should see that the WebdriverIO tests passed. Then you can open the swaglabs Test Activity in your browser, click on the coverage icon and open the functional coverage results for the Test Activity run to see how many end-to-end tests were created to complete 100% user journey coverage.