azure - 在 Azure Devops 中运行 Canopy

标签 azure f# azure-devops canopy-web-testing

我有几个用 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

之后一切正常。

关于azure - 在 Azure Devops 中运行 Canopy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54266689/

相关文章:

.net - FParsec 中的尾递归

f# - 如何在 F# 交互式中查看运算符的类型?

types - F# 强制转换/将自定义类型转换为原始类型

azure devops ,使用变量组中的变量调用服务器命令

azure-devops - Azure DevOps 部署组 - 是否可以忽略离线目标?

javascript - 如何为 adal-angular6 配置生成动态数据

asp.net - Application Insights 扩展破坏了 Azure Web 应用程序

wcf - Azure服务总线中继偶尔发生FaultException

xcode - 使用 VSTS 构建 ionic 应用并将其部署到 android 和 IOS

powershell - 如何以编程方式在 Azure VM 上设置 Powershell 远程处理