2
votes

I followed the tutorials in the docs for azure devops with regards to running Selenium tests as part of the build.

My local tests run fine with the browsers I have webdrivers installed for, but when the VSTest task runs, it doesn't unpack any tests from anything under NUnit attributes.

Now a few things to point out with my project structure:

  1. The test project started out as a basic Visual Studio 2017 Unit Test template, with MS Test.
  2. I preferred NUnit, so I am writing/rewriting the tests using that framework instead of the MSTest it was created with.

My current azure devops pipeline config: azure devops pipeline

Working local tests setup:

enter image description here enter image description here

Now, I can easily add a new project using the NUnit template which for whatever reason allows the azure build to see these tests, but that causes my project structure to change and it defaults to netcoreapp2.1 instead of 4.6, and then the azure build can't find all sorts of stuff.

2

2 Answers

1
votes

Please follow the below steps may it resolve your issue

  • There is no need to add TestAdapter.dll in Test files
  • uncheck "Test mix contains UI tests"
  • Select test platform using "version" as "Installed by Tools Installer"

or

You might need to search the test dll into $(System.DefaultStagingDirectory) folder. sometimes azure agent place the dlls in staging directory instead of defaultworkingdirectory.

0
votes

When adding a new NUnit project by the visual studio template like so enter image description here It defaults the framework version to netcoreapp2.1 enter image description here

If I change this to my build framework (net461), although the build states the same "These dlls will be skipped" message, the NUnit3Adapter is somehow now recognized and picks up the NUnit tests: enter image description here