1

I have a couple of automated tests written in Canopy. I run them locally by running the following command:

dotnet run Project.AutomatedTests.fsproj

on Azure DevOps I tried to configure them the same way, so I have the following steps:

1.

dotnet restore Project.sln

2.

dotnet build Project.sln

3.

dotnet run Project.AutomatedTests.dll

But Azure DevOps fails with following error:

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

I also tried running:

dotnet run Project.AutomatedTests.fsproj

But it fails with the same error.

I tried to run it with --project argument like that:

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

but tests hangs up with the following exception:

 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)

Maybe someone has an idea what I did wrong?

MNie
  • 1,347
  • 1
  • 15
  • 35
  • Try set the verbosity flag to d or diag to get more info (dotnet run -v d ...) – nilekirk Jan 19 '19 at 13:45
  • Nothing change. There is also a communicate that the file was not found. But when I run dotnet build instead of run everything was ok. – MNie Jan 19 '19 at 14:32
  • Seems that maybe dotnet run looks for dlls in ../Release/... Maybe you are building with Debug configuration. Try pass -c Release to dotnet build. – nilekirk Jan 19 '19 at 14:41
  • Nope with release. – MNie Jan 19 '19 at 14:43
  • Maybe you could setup a minimal repo example repository on git? Here is a repo of some canopy test I wrote for a blog post https://github.com/dburriss/PageModuleModelExample . It uses dotnet core so maybe it will help? Note that you run (Powershell) `dotnet .\CoolblueUiTests.dll`. Note the `run` part is gone when executing a dll. – Devon Burriss Jan 23 '19 at 20:06
  • I forgot to mention that when I use chromeheadless, project argument and unix hosted agent everything works fine. I will post an answer in a while. – MNie Jan 23 '19 at 20:13

1 Answers1

1

The solution to my problem was:

start ChromeHeadless

instead of:

start chrome

and after that everything works just fine.

MNie
  • 1,347
  • 1
  • 15
  • 35