webdriverio: [πŸ› Bug]: Running a single scenario using the scenario line number is not working in @wdio/cucumber-framework version 7.11.0 and later

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

v14.18.1

Mode

WDIO Testrunner

Which capabilities are you using?

{
"browserName": "chrome",
}

What happened?

Update β€œ@wdio/cucumber-framework” to any version higher than 7.10.1 and notice if you try to ,Run scenario by line number eg

wdio.js run wdio.conf.js --spec
./tests/e2e/a.feature:5

It will run the entire feature file with all the scenarios

What is your expected behavior?

The scenario which is present in the specified line number should be executed

How to reproduce the bug.

In package.json upgrade the β€œ@wdio/cucumber-framework”: β€œ7.16.6”, do an npm install and run any scenario in a feature file by passing the below command

say

wdio.js run wdio.conf.js --spec ./tests/e2e/a.feature:5

Note all the scenarios in the a.feature will be running, instead of the scenario present in line number 5

Relevant log output

The results of all the scenarios executed is displayed

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 31 (24 by maintainers)

Most upvoted comments

Sure, might be a week or so but I’ll try.

I will be closing this ticket. If anyone wants to raise a PR to apply changes made in #10772 to the v7 branch I am happy to merge and release that for everyone still using v7.

@hammzj Totally understand! What is weird is it may not be that commit that is the errant code but that is exposed a flaw in logic in @wdio/cucumber-framework, like relying on specs and spec.

What order of operations for Cucumber scenario filtering is there? Keeping in mind we have 3 possible inputs for --spec:

  • Cucumber Feature path
  • Cucumber Feature path with Scenario line number
  • Mocha/Jasmine test files

@christian-bromann Working on figuring that out now. I am hoping that the V7 fix would carry over to V8 with minimal issues.

Fairly confident this is caused by #8432.