workerIndex in event.suite.before not found

未关闭
#2,850 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
领域
testing-qa

调研方向

首先跟踪 worker.on(event.suite.before) 和 event.dispatcher 处理器,包括 WorkerEmitter payload,以确定可以在哪里暴露 workerIndex。完成的标准是 event.suite.before 提供当前 worker 索引,以便分配特定于 worker 的数据,并在相关测试覆盖中验证该行为。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
JavaScript
星标
4.2k
派生
756
平均合并
2 天 9 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codeceptjs/CodeceptJS 的其他 Issue

查看 codeceptjs/CodeceptJS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。