Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Cannot grab browser logs on failure with multiple workers - question

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript, nodejs
领域
testing-qa

调研方向

从 run-workers 命令、event.test.failed hook 以及 issue 中链接的自定义并行执行文档开始。比较使用 run-workers 与 run 时浏览器访问和失败事件的行为,然后验证在使用多个 worker 时,测试失败后是否可以捕获浏览器日志。

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

描述

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
主要语言
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 摘要。