我已经设置了一个自定义 wdio 服务(根据文档),它用于为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.
您可以通过克隆示例 repo并运行来自己运行示例npm run test
。
注意:这应该会失败,因为它正在寻找Angles 仪表板的本地实例。
为什么 SevereServiceError 没有停止测试运行的任何想法?