Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Cannot grab browser logs on failure with multiple workers - question

Open
#2,818 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, nodejs
Domain
testing-qa

Research direction

Start with the run-workers command, the event.test.failed hook, and the custom parallel execution documentation linked in the issue. Compare how browser access and failure events behave with run-workers versus run, then verify that browser logs can be captured after a failed test when using multiple workers.

Written by the indexing model from the issue text.

Description

enhancement
What are you trying to achieve?

I want to grab browser logs when some test failed, tests are run using command: ./node_modules/.bin/codeceptjs run-workers 2 --grep "@sometesttag" --plugins allure

And I see that custom hook:

event.dispatcher.on(event.test.failed, async (test, error) => { 

})

inside which I use await I.grabBrowserLogs(); is not working when we use multiple workers. (when we use run-workers command, with run this code works OK)

Tried also surround some part of the code with try / catch block and call await I.grabBrowserLogs(); on error, but it does not work either.

Is this possible to make it working, simply to grab logs from browser on test failure (i.e. some element is not clickable on the page, or it is not in DOM), when we are using multiple workers? FYI - with standard run command I am using custom hook and it works like a charm. And I would like to achieve something similar but when multiple workers are used. Is this possible? I believe it might be doable using https://codecept.io/parallel/#custom-parallel-execution but then, I assume that browser control must be customized as well, and then we simply won't be able to use built-in method on I actor, right?

Details
  • CodeceptJS version: 3.0.5
  • NodeJS Version: 12.20.2
  • Operating System: macOS Catalina
  • puppeteer
Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

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.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.