codeceptjs / codeceptjs/CodeceptJS

workerIndex in event.suite.before not found

Đang mở
#2,850 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
757
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Mô tả

#### 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

```js
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.

```js
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

```js
# paste config here
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.