Skip to content

[🐛 Bug]: Number of workers created not filtered by cucumber tags #8253

@darnold24

Description

@darnold24

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

7.16.16

Node.js Version

16.3.0

Mode

WDIO Testrunner

Which capabilities are you using?

No response

What happened?

When running yarn test:features in the root of the cucumber-boiler plate project (link provided in steps to reproduce), the number of workers created does not take cucumber tag filtering into account. In the file cucumber-boilerplate/wdio.conf.ts on line 176, if I replace tagExpression: 'not @Pending', with tagExpression: '@test', and then add the @test tag to 3 cucumber scenarios I see the following in the terminal.

╰─ yarn test:features
yarn run v1.22.10
$ wdio run wdio.BUILD.conf.ts

Execution of 30 workers started at 2022-04-19T21:06:27.792Z

This does not prevent the tests from starting, however in the case of our project, 280 workers created for large feature files is causing a 15 minute delay before the tests start.

What is your expected behavior?

If there are 3 scenarios tagged in 3 separate feature files, it should create 3 workers, not 30.

Please note, it is possible to create only one worker by adding an inner array to the array of spec files.

specs: [
        ['./src/features/**/*.feature'],
    ],

However I expect the behavior to be one worker per feature file so it is reported correctly at the end. See this article here: https://webdriver.io/blog/2019/11/01/spec-filtering/

How to reproduce the bug.

You can reproduce this in the cucumber boilerplate project here: https://github.com/webdriverio/cucumber-boilerplate

Steps to Reproduce:

  1. Clone the above project
  2. Run yarn install in the projects root directory
  3. Change line 176 in the file cucumber-boilerplate/wdio.conf.ts from tagExpression: 'not @Pending', to tagExpression: '@test',.
  4. Add the @tag tag to 3 different scenarios in 3 different feature files located in cucumber-boilerplate/src/features. The tag should be added in the line above the scenario name as such:
@test
    Scenario: Test if element responds to button press
        Given the element "#testKeyResponse" not contains any text
        When  I press "b"
        Then  I expect that element "#testKeyResponse" not contains the text "65"
  1. In the root directory of the project run yarn test:features

Relevant log output

yarn run v1.22.10
$ wdio run wdio.BUILD.conf.ts

Execution of 30 workers started at 2022-04-19T21:06:27.792Z

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

Labels

Bug 🐛help wantedIssues that are free to take by anyone interested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions