Skip to main content

Vitaq AI WebdriverIO Service

Configuring Vitaq AI for Test Activity runs

Vertizan has developed a custom WebdriverIO service called "vitaqai" that enables WebdriverIO users to take advantage of the AI-driven, end-to-end Test Automation tool, Vitaq AI. It connects WebdriverIO to the vitaq.online cloud so that user created Test Activities can be run using WebdriverIO CLI.

The service contains many configurations that can either be set in the settings section of the vitaq.online dashboard or in the service configuration in wdio.conf.js or with the command line.

The command line takes precedence, then the wdio.conf.js then the settings in the dashboard.

When defining the settings on the command line, use -- (minus minus, with no space) as a prefix e.g.,

>npx wdio run  wdio.conf.js --seed 1-10 --sequence myUserJourney1

For Boolean values, any value that looks like a Boolean can be used e.g. true/false, yes/no, on/off, 1/0.

Command line and config file (wdio.conf.js) parameters

Required parameters:

--userName (no default value)

Specify the user name to log into a valid Vitaq account

npx wdio run wdio.conf.js --userName maria@wside.com

userName in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: false
}],

--userAPIKey (no default value)

Specify the user API key which you obtain from your vitaq account in vitaq.online (Top right user menu -> Get API Key)

npx wdio run wdio.conf.js --userAPIKey yudfgiudfiug

userAPIKey in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: false
}],

--projectName (no default value)

Specify the project name that contains the Test Activity that you want to run with WebdriverIO

npx wdio run wdio.conf.js --projectName onBoarding

projectName in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: false
}],

--testActivityName (no default value)

Specify the test activity name you wish to run with WebdriverIO

npx wdio run  wdio.conf.js --testActivityName swaglabs

#### testActivityName in wdio.conf.js
```js
services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: false
}],

--url (Default: "https://vitaq.online")

Specify the URL to access Vitaq in the cloud

npx wdio run  wdio.conf.js --url https://vitaq.online

url in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: false
}],

Optional parameters:

--useSync (Default: false)

Specify if you want to use WebdriverIO sync or async mode, provided for backward compatability only. We recommend you use async mode.

npx wdio run  wdio.conf.js --useSync true

useSync in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true
}],

--reloadSession (Default: false)

Specify if the browser session should be reloaded prior to the next seed, at the expense of a longer test time. Applications that store state should be reloaded

npx wdio run  wdio.conf.js --reloadSession true

reloadSession in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true
}],

--seed (no default value*)

Specify the seed number to use. Seed needs to be of the form: 1-5,6,7,8,9,10-16,17 - no spaces, only allowable characters are 0-9, comma and dash. The seed to use can also be specified by editing the property on the start node of the test activity diagram.

npx wdio run  wdio.conf.js --seed 1-100

*If this option is not specified in the WDIO environment then the setting from the Test Activity start node is used.

seed in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true,
seed: 1-100
}],

--sequence (no default value)

Specify the name of the sequence to run, this can take the name of a single sequence or a comma separated list of sequences. This is primarily intended as a debugging utility to run the specified sequence(s) once only. Consequently, the Vitaq will attempt to run each sequence once only, irrespective of the coverage target.

>npx wdio run  wdio.conf.js --sequence userJourneyBackpack
>npx wdio run wdio.conf.js --sequence userJourneyBackpack,userJourneyBikelight

sequence in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true,
seed: 1-100,
sequence: userJourneyBackpack
}],

--sequences (Default: false)

A flag used to indicate that Vitaq should attempt to run all the sequences before attempting to increase coverage of actions or variables. When this option is used Vitaq will attempt to run each sequence as many times as specified by the coverage hit target or until coverage is met, whichever is first. After running the sequences, Vitaq will attempt to meet the coverage target of actions or variables.

npx wdio run  wdio.conf.js --sequences true

sequences in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true,
seed: 1-100,
sequences: true
}],

--actions (Default: false)

A flag used to indicate that Vitaq should search for actions which have not met their coverage targets. This has the benefit that coverage will be met in fewer test runs, but has the downside that there will be less exploration of the test space, making the testing more like a series of directed tests with little variability (i.e. it is likely that a similar path will be taken through the diagram to the action that needs coverage)

npx wdio run  wdio.conf.js --actions true

actions in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true,
seed: 1-100,
actions: true
}],

--useCoverage (no default value*)

Specify if you want to use the QA coverage functionality of Vitaq

npx wdio run  wdio.conf.js --useCoverage true

*If this option is not specified in the WDIO environment then the setting from the Test Activity Settings is used.

This option is automatically enabled when using the --useAI or --sequences options.

useCoverage in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true,
seed: 1-100,
useCoverage: true
}],

--hitOnError (no default value*)

Setting to indicate if a coverage hit should be recorded when an error occurs

npx wdio run  wdio.conf.js --hitOnError true

*If this option is not specified in the WDIO environment then the setting from the Test Activity Settings is used.

hitOnError in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useSync: true,
reloadSession: true,
seed: 1-100,
hitOnError: true
}],

--useAI (no default value*)

Setting to make Vitaq use artificial intelligence machine learning functionality to close QA coverage

npx wdio run  wdio.conf.js --useCoverage true --useAI true

*If this option is not specified in the WDIO environment then the setting from the Test Activity Settings is used.

useAI in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useCoverage: true,
useAI: true
}],

--aiVariability (no default value*)

Determines how much exploration is done. A value for the starting variability to use for the AI between 0 and 1

npx wdio run  wdio.conf.js --useCoverage true --useAI true --aiVariability 0.1

*If this option is not specified in the WDIO environment then the setting from the Test Activity Settings is used.

aiVariability in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useCoverage: true,
useAI: true,
aiVariability: 0.1
}],

--aiVariabilityDecay (no default value*)

Specifies how quickly we move from exploration to directed. A value to use for the decay of the variability between 0 and 1

npx wdio run  wdio.conf.js --useCoverage true --useAI true --aiVariability 0.1 --aiVariabilityDecay 0.9

*If this option is not specified in the WDIO environment then the setting from the Test Activity Settings is used.

aiVariabilityDecay in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useCoverage: true,
useAI: true,
aiVariability: 0.1,
aiVariabilityDecay: 0.9
}],

--noProgressStop (no default value*)

Specify how many runs to complete without the coverage increasing before Vitaq stops the run.

npx wdio run  wdio.conf.js --useCoverage true --useAI true --aiVariability 0.1 --aiVariabilityDecay 0.9 --noProgressStop 10

*If this option is not specified in the WDIO environment then the setting from the Test Activity Settings is used.

noProgressStop in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useCoverage: true,
useAI: true,
aiVariability: 0.1,
aiVariabilityDecay: 0.9,
noProgressStop: 10
}],

--aiRandomSeed (no default value*)

Specify if the AI should use a random seed or start from 1

npx wdio run  wdio.conf.js --useCoverage true --useAI true --aiVariability 0.1 --aiVariabilityDecay 0.9 --noProgressStop 10 --aiRandomSeed true

Default: no default value, if not specified in WDIO environment comes from VitaqUI settings

aiRandomSeed in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
useCoverage: true,
useAI: true,
aiVariability: 0.1,
aiVariabilityDecay: 0.9,
noProgressStop: 10
aiRandomSeed: true
}],

Timeout parameters:

--scriptTimeout (Default: 20000)

Specify the time (in milliseconds) for the VitaqAI service to wait for the generation of the test script. This should rarely need to be used.

npx wdio run  wdio.conf.js --scriptTimeout 30000

scriptTimeout in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
scriptTimeout: 30000
}],

--sessionTimeout (Default: 20000)

Specify the time (in milliseconds) for the VitaqAI service to wait to connect to the cloud service. This should rarely need to be used.

npx wdio run  wdio.conf.js --sessionTimeout 30000

sessionTimeout in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
sessionTimeout: 30000
}],

--authenticationTimeout (Default: 20000)

Specify the time (in milliseconds) for the VitaqAI service to wait for authentication with the cloud service. This may need to be increased if Vitaq is being used on a very slow network.

npx wdio run  wdio.conf.js --authenticationTimeout 30000

authenticationTimeout in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
authenticationTimeout: 30000
}],

--nextActionTimeout (Default: 300000)

Specify the time (in milliseconds) for the VitaqAI service to wait to get the next action from the cloud service. This may need to be increased if Vitaq is being used on a network which is liable to drop connections and takes time to reconnect.

npx wdio run  wdio.conf.js --nextActionTimeout 500000

nextActionTimeout in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
nextActionTimeout: 500000
}],

--debug (Default: false)

A shorthand way to increase the value of all the timeouts described above. Using this option sets the timeouts as follows:

  • scriptTimeout set to 60000 (1 minute)
  • sessionTimeout set to 60000 (1 minute)
  • authenticationTimeout set to 60000 (1 minute)
  • nextActionTimeout set to 3600000 (1 hour)
npx wdio run  wdio.conf.js --debug true

nextActionTimeout in wdio.conf.js

services: [
['vitaqai', {
userName: 'maria@wside.com',
projectName: "onBoarding",
testActivityName: 'swaglabs',
url: "https://vitaq.online",
userAPIKey: "ugeiugdeug",
debug: true
}],