从 Visual Studio 扩展打开测试结果
我有一个 Visual Studio 扩展,它在外部服务中运行测试并将结果作为 .trx 文件返回。在扩展代码中,如何显示“测试结果”窗口并在那里打开结果文件?与我在外部单击 .trx 文件时发生的情况类似。
I have a Visual Studio extension that runs tests in an external service and gets the results back as a .trx file. In the extension code, how do I display the Test Results window and open the result file there? Similarly as would happen if I clicked the .trx file externally.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不直接将数据加载到窗口中,但更通用的解决方案是通过 ItemOperations 打开文件:
这当然适用于 Visual Studio 识别的任何类型的文件。
Not loading the data into the window directly, but a more general solution is to open the file through ItemOperations:
This will of course work with any type of file Visual Studio identifies.
十年后,我正在做一件非常类似的事情,我已经弄清楚如何将测试加载到 VS2022 到测试结果资源管理器中,但现在我试图弄清楚如何打开指向文件和行的选定测试它位于。
我想知道这是否可能,或者这种功能是否对最终用户隐藏。
ten years later, I’m doing a very similar thing, I have figured out how to load tests into VS2022 into the test results explorer, but now I’m trying to figure out how to open a selected test directed to the file and line it’s located at.
I wonder if this is even possible, or if that kind of functionality is hidden from end users.