我有几个用 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)
也许有人知道我做错了什么?