Skip to content

[🐛 Bug]: <JUNIT REPORTER - test count incorrect when no test executed> #14720

@xbrys31

Description

@xbrys31

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.19.2

Node.js Version

22.13.0

Mode

Standalone Mode

Which capabilities are you using?

What happened?

Context :

  • fresh install of webdriverio
  • wdio v19.2 with cucumber and junit reporter
  • features with cucumber tags. login feature with tag "@prod"
  • npm script like :
    "wdio": "wdio run ./wdio.conf.ts --cucumberOpts.tags ='PROD' "

Actual behavior
When Executing the script with feature with tag = @prod, junit file is ok
example : <testsuite tests="1" failures="0" errors="0" skipped="0"

When Executing the script with feature with tag = @staging (this tag doesn't match with any features), junit file is not ok for me
example : <testsuite tests="1" failures="0" errors="0" skipped="1"

tests should be equal to 0 and also skipped to 0, because no test have to be executed (and no test have been executed) regarding the tags

What is your expected behavior?

When Executing the script with feature with tag = "@staging" (this tag doesn't match with any features), junit file is not ok for me
example : <testsuite tests="1" failures="0" errors="0" skipped="1"

We should have
<testsuite tests="0" failures="0" errors="0" skipped="0"

How to reproduce the bug.

To reproduce the bug

  • install webdriverio (9.19.2) with cucumber-framework, local runner, spec reporter, junit reporter, accept generating some test files
  • update login feature to add a tag "@prod"
  • update sript wdio in the package.json :
  • "wdio": "wdio run ./wdio.conf.ts --cucumberOpts.tags ='@staging' "

Content of th junit file should be

Relevant log output

npm run wdio 

> wdio
> wdio run ./wdio.conf.ts --cucumberOpts.tags ='@STAGING'


Execution of 1 workers started at 2025-08-25T10:52:07.461Z

2025-08-25T10:52:07.489Z INFO @wdio/cli:launcher: Run onPrepare hook
2025-08-25T10:52:07.490Z INFO @wdio/utils: Setting up browser driver for: chrome@stable
2025-08-25T10:52:07.491Z INFO @wdio/utils: Setting up browser binaries for: chrome@stable
2025-08-25T10:52:07.493Z INFO webdriver: Using Chromedriver v139.0.7258.139 from cache directory C:\Users\Xavie\AppData\Local\Temp
2025-08-25T10:52:07.498Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2025-08-25T10:52:07.499Z INFO @wdio/xvfb: XvfbManager.init() called
2025-08-25T10:52:07.499Z INFO @wdio/xvfb: Xvfb not needed on current platform
2025-08-25T10:52:07.502Z INFO @wdio/local-runner: Start worker 0-0 with arg: run ./wdio.conf.ts --cucumberOpts.tags ='@STAGING'
2025-08-25T10:52:07.524Z INFO @wdio/xvfb:ProcessFactory: xvfb-run not found, falling back to regular fork
2025-08-25T10:52:07.524Z INFO @wdio/xvfb:ProcessFactory: ProcessFactory: shouldRun=false, isAvailable=false   
2025-08-25T10:52:07.524Z INFO @wdio/xvfb:ProcessFactory: Creating worker process with regular fork
[0-0] 2025-08-25T10:52:08.727Z INFO @wdio/local-runner: Run worker command: run
2025-08-25T10:52:09.586Z INFO @wdio/cli: [0-0] SKIPPED in chrome - file:///C:/dev/typescript/wdioV9_TEST_TO_BE_DELETED/features/login.feature
2025-08-25T10:52:09.587Z INFO @wdio/cli:launcher: Run onWorkerEnd hook

 "junit" Reporter:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" failures="0" errors="0" skipped="1">
  <testsuite tests="1" failures="0" errors="0" skipped="1">
    <testcase classname="" name="">
      <skipped/>
    </testcase>
  </testsuite>
</testsuites>

Spec Files:      0 passed, 1 skipped, 1 total (100% completed) in 00:00:02

2025-08-25T10:52:09.588Z INFO @wdio/local-runner: Shutting down spawned worker
2025-08-25T10:52:09.846Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2025-08-25T10:52:09.846Z INFO @wdio/local-runner: shutting down
2025-08-25T10:52:09.847Z INFO @wdio/cli:launcher: Run onComplete hook

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

    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