运行 Azure Devops 中的 Canopy

Running Canopy in Azure Devops

我有几个用 Canopy 编写的自动化测试。我 运行 通过 运行 在本地使用以下命令:

dotnet run Project.AutomatedTests.fsproj

在 Azure DevOps 上,我尝试以相同的方式配置它们,所以我有以下步骤:

1.

dotnet restore Project.sln

2.

dotnet build Project.sln

3.

dotnet run Project.AutomatedTests.dll

但是 Azure DevOps 失败并出现以下错误:

2019-01-19T11:11:42.5195371Z ##[error]Error: /usr/bin/dotnet failed with return code: 1
2019-01-19T11:11:42.5219579Z ##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/backend/tests/Project.AutomatedTests/bin/Release/netcoreapp2.1/Project.AutomatedTests.dll,/home/vsts/work/1/s/backend/tests/Project.AutomatedTests/bin/Release/netcoreapp2.1/publish/Project.AutomatedTests.dll,/home/vsts/work/1/s/backend/tests/Project.AutomatedTests/obj/Release/netcoreapp2.1/Project.AutomatedTests.dll

我也试过运行宁:

dotnet run Project.AutomatedTests.fsproj

但它失败并出现同样的错误。

我试过 运行 它用 --project 这样的论点:

-v d --project /home/vsts/work/1/s/backend/tests/Project.AutomatedTests/Project.AutomatedTests.fsproj

但测试挂起并出现以下异常:

 at Start.main(String[] _arg1) in /home/vsts/work/1/s/backend/tests/Project.AutomatedTests/Program.fs:line 17
   at canopy.classic.start(BrowserStartMode b) in C:\projects\canopy\src\canopy\canopy.fs:line 250
   at canopy.parallell.functions.start(BrowserStartMode b) in C:\projects\canopy\src\canopy\canopy.parallell.functions.fs:line 835
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)

也许有人知道我做错了什么?

我的问题的解决方案是:

start ChromeHeadless

而不是:

start chrome

之后一切正常。