webdriverio / webdriverio/webdriverio

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

Open
#11,907 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug 🐛 help wanted
Dominant language
TypeScript
Stars
9.8k
Forks
2.7k
Avg merge
2d 13h
Merged PRs (30d)
69

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the configurationfile documentation linked in the issue, especially the OnComplete hooks section and its description of the results parameter. Reproduce the two-worker example and compare the hook output with the displayed Spec Files summary; done means the documentation or behavior clearly identifies whether results describe workers or test cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
documentation, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.