Use different config file for different scenarios

I’m using codeceptjs with webdriverIO

I have a framework with 2 different config files ‘codecept.conf’ (for running tests on desktop) and ‘codecept.mobile.conf’ (for running tests on mobile devices)

how it runs?
it runs a scenario which first creates test data on the backend (wordpress) and then validate it on the front-end website

what’s the problem?
the data creation part must only execute on desktop device and not in mobile

what I’m trying to achieve?
I’m looking for a way to execute one scenario (data creation part) in desktop (using ‘codecept.conf’) and another scenario (data validation part) (in the same feature file) in mobile (using ‘codecept.mobile.conf’)

there are some solutions available for Puppeteer e.g. https://github.com/codecept-js/CodeceptJS/pull/1053/files, but apparently they it doesn’t apply to webdriver IO as tests in wdIO are written in feature files and not JS files

@murtaza9teen91 you can use CodeceptJS tags for that use case

@paulb thanks for your swift response,
the test data that’s created with on desktop (using scenario 1) needs to be used by mobile (scenario 2) i.e. that needs to be executed in a single run so tags won’t work in this case I suspect

@murtaza9teen91 you need to decouple both scenarios.

you need to arrange preconditions for mobile scenario not with another test szenario but with fixtures or api calls in your app.

CodeceptJS does not support running scenarios in a guaranteed order.

(workaround is to use file names to guanratee order. And this workaround fails with parallel scenario execution)