I am trying to run automated test from Test Plan in Azure. As per the documentation -> https://docs.microsoft.com/en-us/azure/devops/test/run-automated-tests-from-test-hub?view=azure-devops, I have created build and release definitions, and to Select tests using is set to Test run. When i run the test, stage is passed with out executing the test and a warning "unable to find any test file matching the pattern *test.dll !TestAdapter.dll !\obj is displayed. But my test pattern looks something different .Tests.dll and we cannot change this pattern if we use Test Run as option in Classic editor. I couldnt find a way to use YAML pipeline to update the test assemblies. Is there any other way to change the test pattern. ?
2 Answers
Unlike any other UI test, it's not able to change dll pattern for running automated Tests from Azure Test Plan. It's only able to pass parameters to your test code.
Q: How do I pass parameters to my test code from a build or release pipeline?
A: Use a runsettings file to pass values as parameters to your test code. For example, in a release that contains several stages, you can pass the appropriate app URL to each the test tasks in each one. The runsettings file and matching parameters must be specified in the Visual Studio Test task.
Pass parameters to test code from a build or release pipeline
As a workaround, you may need to change your test pattern to .Tests.dll
I was able to over come this by following steps in below articles. Hope it will be useful for others. [https://medium.com/@drewelewis/simplified-automated-qa-testing-on-azure-devops-43d15305df85] [https://docs.microsoft.com/en-us/azure/devops/test/run-automated-tests-from-test-hub?view=azure-devops]