node.js - 赛普拉斯 UI 测试因等待浏览器而超时
问题描述
我正在AzureDevOps
CI/CD 中运行赛普拉斯 UI 测试,并且大多数 UI 测试都失败了。几天前,所有测试都运行良好。它抛出一个Timed out waiting for the browser to connect. Retrying.
错误:关于如何解决问题的任何建议。
环境详细信息: Cypress 版本:3.4.1,节点:10.x,Azure DevOps CI/CD
Running: report/send-report.spec.js... (12 of 14)
2019-10-10T00:47:31.0294852Z
2019-10-10T00:47:31.0295427Z Warning: Cypress can only record videos when using the built in 'electron' browser.
2019-10-10T00:47:31.0295707Z
2019-10-10T00:47:31.0296579Z You have set the browser to: 'chrome'
2019-10-10T00:47:31.0296837Z
2019-10-10T00:47:31.0297613Z A video will not be recorded when using this browser.
2019-10-10T00:47:31.0313740Z (node:4030) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit
2019-10-10T00:48:01.0316223Z
2019-10-10T00:48:01.0592004Z Timed out waiting for the browser to connect. Retrying...
2019-10-10T00:48:31.0587550Z
2019-10-10T00:48:31.0839142Z Timed out waiting for the browser to connect. Retrying again...
2019-10-10T00:49:01.0877330Z
2019-10-10T00:49:01.1241198Z The browser never connected. Something is wrong. The tests cannot run. Aborting...
解决方案
我注意到您已将重试值设置为 2 以启用在失败时立即重试,而不是继续进行下一个测试。所以我建议您更改该值并检查错误是否仍然存在。
您可以尝试另一种解决方法,将numTestsKeptInMemory
50 更改为类似1
或0
. 这是官方文档。https://docs.cypress.io/guides/references/configuration.html#Global
此外,这似乎是一个偶然的错误。因为有些用户在第一个管道上失败了,但在第二个管道上成功了。而这应该是cypress本身或者你系统内存的问题,你可以直接向cypress报告这个问题。
这是关于 cypress-io/cypress 的链接。https://github.com/cypress-io/cypress/issues/
这是有关相同错误消息的链接。https://github.com/cypress-io/cypress/issues/1305
推荐阅读
- mysql - 从一个表中选择多个列,从另一个表中获取相应的详细信息并将它们插入到另一个表中
- nopcommerce - 在退出 nop commerce 视图中添加新输入,并在 nop commerce 4.2 中为 DB 中的输入创建数据库
- swift - 没有使用 pod swift 5 的模块“SDWebImage”
- javascript - jquery append 删除和追加
- python - 在开发 Django 项目时,Docker 是“virtualenv”的替代品吗?
- javascript - 从 Arduino WebSocket sendBIN 获取数据到 Javascript 作为 Blob
- amazon-web-services - 无法从 docker 容器访问 aws s3。被拒绝
- python - 从模型传递参数
- scala - 如何将scala数据框的每一行映射到新模式
- java - 为什么 ('1'+'1') 在 Java 中输出 98?