Webdriverio: wdio.conf.js file is run more than once

Created on 31 Jul 2016  路  1Comment  路  Source: webdriverio/webdriverio

when using the wdio test runner, the config file is run more than once.
not sure what causes it to run more than once, i've seen it run between 2 and 4 times in my setup.

this actually starts multiple test runs for us, so when running in the cloud it runs every test 3 times. locally it sometimes tries to run more than once at the same time so some runs fail and some pass.

its very easy to reproduce, just add a console.log('this should only happen once') in the wdio.conf.fjs file.

here's a sample repo with the issue if you want to use it:
https://github.com/talarari/AppiumSwitchContextBug

Most helpful comment

This is correct. The config file is being read before we start the test runner (to evaluate the onPrepare hook) and when we kick off the test runner. So when you have one test spec you will see the console.log being printed twice. When you have two test specs you will see it being printed 3 times and so one.

>All comments

This is correct. The config file is being read before we start the test runner (to evaluate the onPrepare hook) and when we kick off the test runner. So when you have one test spec you will see the console.log being printed twice. When you have two test specs you will see it being printed 3 times and so one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christian-bromann picture christian-bromann  路  3Comments

mrahman2327 picture mrahman2327  路  3Comments

imranazad picture imranazad  路  3Comments

aminerouh picture aminerouh  路  3Comments

sarahdayan picture sarahdayan  路  4Comments