WebdriverIO SevereServiceError 未停止测试运行
我已经设置了 自定义 wdio 服务< /a> (根据文档)用于创建Angles 自动化仪表板 的构建。
作为此服务的一部分,我想在无法使用时使用 SevereServiceError创建构建并停止运行。但是,在 我的示例测试 中,它会抛出错误并继续测试运行。请参阅此处的日志:
2022-03-05T07:28:36.936Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-03-05T07:28:36.936Z INFO chromedriver: Start Chromedriver (/git/angles/webdriverio-example/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --port=9515 --url-base=/
2022-03-05T07:28:36.982Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
SevereServiceError: Unable to create a build due to connect ECONNREFUSED 127.0.0.1:3000.
at /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/angles-wdio-reporter/src/integrations/wdio/AnglesWDIOService.ts:57:15
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/@wdio/cli/build/utils.js:28:17
at async Promise.all (index 1)
at async Launcher.run (/Users/sergios/Documents/git/angles/webdriverio-example/node_modules/@wdio/cli/build/launcher.js:86:13)
Continue...
2022-03-05T07:28:36.985Z INFO chromedriver: Starting ChromeDriver 98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}) on port 9515
2022-03-05T07:28:36.987Z INFO chromedriver: Only local connections are allowed.
您可以通过克隆 示例存储库 并运行 自行运行示例npm 运行测试
。
注意:这应该会失败,因为它正在寻找Angles 仪表板的本地实例。
有什么想法为什么 SevereServiceError 没有停止测试运行吗?
I have setup a custom wdio service (as per the documentation) which is used to create a build for the Angles automation dashboard.
As part of this service I want to use the SevereServiceError when it is unable to create the build and stop the run. However in my example test it throws the error and simply continues the test run. See logs here:
2022-03-05T07:28:36.936Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-03-05T07:28:36.936Z INFO chromedriver: Start Chromedriver (/git/angles/webdriverio-example/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --port=9515 --url-base=/
2022-03-05T07:28:36.982Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
SevereServiceError: Unable to create a build due to connect ECONNREFUSED 127.0.0.1:3000.
at /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/angles-wdio-reporter/src/integrations/wdio/AnglesWDIOService.ts:57:15
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/@wdio/cli/build/utils.js:28:17
at async Promise.all (index 1)
at async Launcher.run (/Users/sergios/Documents/git/angles/webdriverio-example/node_modules/@wdio/cli/build/launcher.js:86:13)
Continue...
2022-03-05T07:28:36.985Z INFO chromedriver: Starting ChromeDriver 98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}) on port 9515
2022-03-05T07:28:36.987Z INFO chromedriver: Only local connections are allowed.
You can run the example yourself by cloning the example repo and running npm run test
.
NOTE: This should fail because it's looking for a local instance of the Angles dashboard.
Any ideas why the SevereServiceError isn't stopping the test run?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过 将 wdio 依赖项以及 ts-node 和 typescript 更新到当前版本,此问题已解决已解决。现在,当抛出 SeverServiceError 时,测试运行会停止。
By updating wdio dependencies and ts-node and typescript to current versions this issue has been resolved. The test run now stops when the SeverServiceError is thrown.