尝试在 Azure 管道中的 Edge 上运行我的业力测试套装时,出现以下错误:
18 05 2020 16:34:20.217:INFO [karma-server]: Karma v5.0.7 server started at http://0.0.0.0:9876/
18 05 2020 16:34:20.217:INFO [launcher]: Launching browsers Edge with concurrency unlimited
18 05 2020 16:34:20.312:INFO [launcher]: Starting browser Edge
18 05 2020 16:34:46.536:ERROR [launcher]: Killing Edge process failed. Error: Command failed: taskkill /t /f /im MicrosoftEdge.exe
ERROR: The process "MicrosoftEdge.exe" not found.
18 05 2020 16:34:46.536:ERROR [launcher]: Cannot start Edge
undefined
18 05 2020 16:34:46.536:ERROR [launcher]: Edge stdout:
Couldn't find Edge URL with URL: 00D53958
Found
18 05 2020 16:34:46.536:ERROR [launcher]: Edge stderr:
18 05 2020 16:34:46.536:INFO [launcher]: Trying to start Edge again (1/2).
18 05 2020 16:35:07.958:ERROR [launcher]: Killing Edge process failed. Error: Command failed: taskkill /t /f /im MicrosoftEdge.exe
ERROR: The process "MicrosoftEdge.exe" not found.
18 05 2020 16:35:07.958:ERROR [launcher]: Cannot start Edge
undefined
18 05 2020 16:35:07.958:ERROR [launcher]: Edge stdout:
Couldn't find Edge URL with URL: 00100250
Found
18 05 2020 16:35:07.958:ERROR [launcher]: Edge stderr:
18 05 2020 16:35:07.973:INFO [launcher]: Trying to start Edge again (2/2).
18 05 2020 16:35:29.343:ERROR [launcher]: Killing Edge process failed. Error: Command failed: taskkill /t /f /im MicrosoftEdge.exe
ERROR: The process "MicrosoftEdge.exe" not found.
18 05 2020 16:35:29.343:ERROR [launcher]: Cannot start Edge
undefined
18 05 2020 16:35:29.343:ERROR [launcher]: Edge stdout:
Couldn't find Edge URL with URL: 013BFFB0
Found
18 05 2020 16:35:29.343:ERROR [launcher]: Edge stderr:
18 05 2020 16:35:29.359:ERROR [launcher]: Edge failed 2 times (cannot start). Giving up.
它运行在微软托管的Windows-2019 VM中,根据文档,它应该正确配置。 有没有人做过这个设置?
作为记录,Internet Explorer在相同的设置下工作正常!
如果与 edge 集成失败,一个简单的解决方法是:即使您没有安装 Chrome,也可以通过将"浏览器"设置更改为"ChromeHeadless",将默认浏览器设置为 ChromeHeadkarma.conf.js
less,如下所示:
browsers: ['ChromeHeadless'],
然后,一旦您运行测试,您就可以在 Microsoft Edge 中打开http://localhost:9876/
,它将显示常规的 Karma 测试窗口。
或者,在不设置默认浏览器的情况下,您也可以使用命令执行相同的操作ng test --browsers ChromeHeadless
我设法使用自定义插件使其工作:https://github.com/karma-runner/karma-edge-launcher
然后,您可以使用Edge
浏览器。