Printing the Console output in the Azure DevOps Test Run task
我正在使用
当我在本地系统上运行测试时,我可以在主功能文件上看到这个钩子函数的输出,以及每个场景下每个场景的输出。但是当我通过 Azure DevOps 管道运行测试时,我不确定在哪里可以找到
谁能帮我把这个输出显示在某个地方,这样我就可以采取相应的行动了。
我尝试使用
1 2 3 4 5 6 | [BeforeTestRun] public static void BeforeRun() { Console.WriteLine( "Before Test run analyzing the users and their needed properties for performing automation run"); } |
我希望我的输出在某处可见,以便在需要时根据该信息采取行动。
控制台日志是不可能的。
The product currently does not support printing console logs for passing tests and we do not currently have plans to support this in the near future.
(来源:https://developercommunity.visualstudio.com/content/problem/631082/printing-the-console-output-in-the-azure-devops-te.html)
但是,还有另一种方式:
您的构建将包含一个文件扩展名为
1 2 3 4 5 6 7 8 9 10 | <TestRun id="[omitted]" name="[omitted] 2020-01-10 17:59:35" runUser="[omitted]" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> <Times creation="2020-01-10T17:59:35.8919298+01:00" queuing="2020-01-10T17:59:35.8919298+01:00" start="2020-01-10T17:59:26.5626373+01:00" finish="2020-01-10T17:59:35.9209479+01:00" /> <Results> <UnitTestResult testName="TestMethod1"> <Output> <StdOut>Test</StdOut> </Output> </UnitTestResult> </Results> </TestRun> |