小编Nit*_*rma的帖子

在 Azure DevOps 测试运行任务中打印控制台输出

我正在使用[BeforeTestRun]钩子为我的规范流测试做一些初始的一次性设置。这确实会检查某些用户以确保他们是否存在,如果不存在,则创建具有特定角色和权限的用户,以便自动化测试可以使用它们。执行此操作的函数会在Console.Writeline. 当我在本地系统上运行测试时,我可以在主功能文件上看到这个钩子函数的输出,以及每个场景下每个场景的输出。但是当我通过 Azure DevOps pipleine 运行测试时,我不确定在哪里可以找到输出,[BeforeTestRun]因为它没有绑定特定的测试场景。Run Tests Tasks 的控制台没有这方面的信息。

有人可以帮我在某处显示此输出,以便我可以采取相应的行动。

我试图用System.Diagnostics.Debug.PrintSystem.Diagnostics.Debug.PrintSystem.Diagnostics.Debug.WriteLineSystem.Diagnostics.Trace.WriteLine,但似乎没有任何管道控制台上工作。

[BeforeTestRun]
public static void BeforeRun()
{
    Console.WriteLine(
        "Before Test run analyzing the users and their needed properties for performing automation run");
}
Run Code Online (Sandbox Code Playgroud)

我希望我的输出在某处可见,以便我可以根据需要根据该信息采取行动。

azure-devops azure-pipelines

6
推荐指数
1
解决办法
9559
查看次数

标签 统计

azure-devops ×1

azure-pipelines ×1