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

workerIndex in event.suite.before not found

Open
#2,850 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js
Domain
testing-qa

Research direction

Start by tracing the worker.on(event.suite.before) and event.dispatcher handlers, including the WorkerEmitter payload, to determine where workerIndex could be exposed. Done means event.suite.before provides the current worker index for assigning worker-specific data, with the behavior verified in the relevant test coverage.

Written by the indexing model from the issue text.

Description

What are you trying to achieve?

I want to do some specific action during event.suite.before, when worker is launched and for that, I need to get the workerIndex in the before event. But currently, it seems to be impossible.
For example, I need to assign a specific datatable to each worker.

What do you get instead?

I try two things :

use worker.on(event.suite.before) but no data is sent with WorkerEmitter

 workers.on(event.suite.before, function (suite) {
   console.log('--- Begin suite --');
   console.log('Index du worker = ' + suite.workerIndex);
   console.log('Suite = ' + suite.title);
 });

use event.dispatcher but workerIndex is not found.

 event.dispatcher.on(event.suite.before, function (suite) {
    console.log('--- Begin workers --');
    console.trace(suite);
  });

I think this kind of information about current worker is very important, isn't it ?
If someone have a solution or a pullrequest to solve this, I'm interesting.

Details
  • CodeceptJS version: 3.0.4
  • NodeJS Version: 13.10.1
  • Operating System: W10
  • puppeteer
# paste config here
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.