It's a common approach to filter specs with tags, grep or any other techniques, however we had a gotcha here before - a new session is created for every spec file which takes some time, especially for mobile tests.
We've added a feature that allows to filter spec files before a session is started. The feature is enabled by default for Cucumber framework only and is disabled by default for Mocha and Jasmine frameworks to avoid breaking changes. To use the feature, it has to be enabled in
wdio.conf.js with feature flag, also all
browser function calls like
browser.addCommand() or any other have to be moved away from root scope. You can still use env flags, config or capabilities as before.
The following is only required for Mocha and Jasmine users who want to use the feature:
- Enable the feature with a flag in
- Move custom commands declaration to
beforehook, if you have such, example:
- Move custom command declarations from root scope to suite level (or move them to another file and require it in
beforehook, see 2.1), if you had such, example:
We are happy to answer any questions and awaiting your feedback.
Please note that the feature will be enabled for all test frameworks in v6 so it's recommended to start preparation in advance.