webdriverio/webdriverio

[🐛 Bug]: onComplete hooks parameter "results" is no clear

Open

#11,907 opened on Dec 20, 2023

View on GitHub
 (8 comments) (0 reactions) (0 assignees)JavaScript (1,793 forks)batch import
Bug 🐛help wanted

Repository metrics

Stars
 (6,029 stars)
PR merge metrics
 (Avg merge 15d 15h) (48 merged PRs in 30d)

Description

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.22.0

Node.js Version

18.15.0

Mode

Standalone Mode

Which capabilities are you using?

capabilities: [
        {
            browserName: 'chrome'
        }
    ],

What happened?

In the official doc in "OnComplete" hooks mention: "results object containing test results" and it's no correct

image

If you run the project that git that has 2 workers and 3 testcases the result that it's showing in the console and if you define a console.log(resutls) in this hooks is something like that

Spec Files: 0 passed, 2 failed, 2 total (100% completed) in 00:00:08

This is Worker's status and not the number of testacases executed

What is your expected behavior?

results paramater in hooks return the number of testcases and not the number of the workers

How to reproduce the bug.

link

Relevant log output

[chrome 120.0.6099.71 windows #0-1]     -false
[chrome 120.0.6099.71 windows #0-1]     +true
[chrome 120.0.6099.71 windows #0-1]
[chrome 120.0.6099.71 windows #0-1]     at World.<anonymous> (file:///C:/Dev/git/testAllure/features/step-definitions/steps.ts:5:35)
[chrome 120.0.6099.71 windows #0-1]     at Object.run (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\user_code_runner.ts:37:21)
[chrome 120.0.6099.71 windows #0-1]     at Object.run (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\step_runner.ts:50:41)
[chrome 120.0.6099.71 windows #0-1]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[chrome 120.0.6099.71 windows #0-1]     at async TestCaseRunner.invokeStep (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\test_case_runner.ts:137:12)        
[chrome 120.0.6099.71 windows #0-1]     at async TestCaseRunner.runStep (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\test_case_runner.ts:334:20)
[chrome 120.0.6099.71 windows #0-1]     at async C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\test_case_runner.ts:240:34
[chrome 120.0.6099.71 windows #0-1]     at async TestCaseRunner.aroundTestStep (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\test_case_runner.ts:170:28)    
[chrome 120.0.6099.71 windows #0-1]     at async TestCaseRunner.runAttempt (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\test_case_runner.ts:218:7)
[chrome 120.0.6099.71 windows #0-1]     at async TestCaseRunner.run (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\test_case_runner.ts:188:29)
[chrome 120.0.6099.71 windows #0-1]     at async Runtime.runTestCase (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\index.ts:89:20)
[chrome 120.0.6099.71 windows #0-1]     at async Runtime.start (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\runtime\index.ts:116:7)
[chrome 120.0.6099.71 windows #0-1]     at async runCucumber (C:\Dev\git\testAllure\node_modules\@cucumber\cucumber\src\api\run_cucumber.ts:125:19)
[chrome 120.0.6099.71 windows #0-1]     at async CucumberAdapter.run (file:///C:/Dev/git/testAllure/node_modules/@wdio/cucumber-framework/build/index.js:186:33)
[chrome 120.0.6099.71 windows #0-1]     at async Runner.run (file:///C:/Dev/git/testAllure/node_modules/@wdio/runner/build/index.js:148:24)


Spec Files:      0 passed, 2 failed, 2 total (100% completed) in 00:00:08

2023-12-14T08:17:58.433Z INFO @wdio/local-runner: Shutting down spawned worker
2023-12-14T08:17:58.696Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-12-14T08:17:58.697Z INFO @wdio/local-runner: shutting down

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

Contributor guide