Skip to content

[🐛 Bug]: Skipping tests in cucumber with @skip is not working #14671

@Nyaran

Description

@Nyaran

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.18.4

Node.js Version

20.11.1

Mode

Standalone Mode

Which capabilities are you using?

{
    browserName: 'chrome'
}

What happened?

In a project with WebdriverIO v9 and Cucumber and a scenario with the tag @skip(browserName=["chrome","safari"]), the execution fails, because cucumber returns an error if one of the skipped browser is set on the capabilities.

What is your expected behavior?

The execution should be successful, skipping the scenarios with the skip tag that matched with the current capabilities

How to reproduce the bug.

I created a reproducible example here: https://github.com/Nyaran/webdriverio-cucumber-skip

Just download it, install dependencies and run

git clone https://github.com/Nyaran/webdriverio-cucumber-skip
webdriverio-cucumber-skip
npm i
npm run wdio

Relevant log output

[0-0] 2025-07-28T18:45:38.414Z ERROR @wdio/local-runner: Failed launching test session: Error: Tag expression "(not @skip\(browserName=\["chrome","safari"\]\))" could not be parsed because of syntax error: Illegal escape before "[".
[0-0]     at tokenize (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/tag-expressions/src/index.ts:104:15)
[0-0]     at parse (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/tag-expressions/src/index.ts:23:18)
[0-0]     at PickleTagFilter (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/cucumber/src/pickle_filter.ts:136:37)
[0-0]     at PickleFilter (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/cucumber/src/pickle_filter.ts:36:22)
[0-0]     at <anonymous> (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/cucumber/src/filter/filter_plugin.ts:15:28)
[0-0]     at PluginManager.transform (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/cucumber/src/plugin/plugin_manager.ts:87:30)
[0-0]     at loadSources (/tmp/webdriverio-cucumber-skip/node_modules/@cucumber/cucumber/src/api/load_sources.ts:50:47)
[0-0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0]     at CucumberAdapter.init (/tmp/webdriverio-cucumber-skip/node_modules/@wdio/cucumber-framework/build/index.js:219:22)
[0-0]     at Object.adapterFactory.init (/tmp/webdriverio-cucumber-skip/node_modules/@wdio/cucumber-framework/build/index.js:508:20)
[0-0] SYNCHRONOUS TERMINATION NOTICE: When explicitly exiting the process via process.exit or via a parent process, asynchronous tasks in your exitHooks will not run. Either remove these tasks, use gracefulExit() instead of process.exit(), or ensure your parent process sends a SIGINT to the process running this code.
[0-0] FAILED

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions