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
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.
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.