如何使用NUnit在VS2010中调试Specflow场景?
我已经随 VS2010 安装了 NUnit 2.5.10 和 Specflow 1.8.1。
在VS中右键单击.feature文件,上下文菜单中有一个“调试Specflow Scenarios”项。但我总是得到“找不到匹配的测试运行程序”。在 Tools/Options/Specflow 中,没有 NUnit 的测试运行器选项。
我错过了什么吗?
提前致谢。 :)
I have NUnit 2.5.10 and Specflow 1.8.1 installed with VS2010.
Right click on .feature file in VS, there is an item "Debug Specflow Scenarios" in context menu. But I always get "Could not find matching test runner". In Tools/Options/Specflow, there is no test runner option for NUnit.
Am I missing something?
Thanks in advance. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不知道 NUnit 是否有一个单独的 GUI 来运行测试,因为我使用 MSTests,但这应该是你的做法。
https://github.com/techtalk/SpecFlow/wiki/Configuration
您可以尝试使用 VS 运行程序,Test >窗口>测试视图
VS 只会将 Specflow 测试视为 NUnit,因为生成的代码背后只是一个 NUnit 测试(以这种方式配置时)。所以我认为真正的问题是如何在 Visual Studio 中调试 NUnit 测试。快速搜索建议将调试器附加到 NUnit 测试运行程序进程。
I don't know if NUnit has a seperate GUI for running tests as i use MSTests but this should be how u do it.
https://github.com/techtalk/SpecFlow/wiki/Configuration
You could try using the VS runner, Test > Windows > Test View
VS will just treat a Specflow test as a NUnit as the generated code behind is just an NUnit test (when configured that way). So i think the real question is how to debug an NUnit test in Visual Studio. A quick search suggested attaching the debugger to the NUnit test runner process.
和 Ryan 一样,我也没有专门针对 Nunit 的测试运行程序。然而,由于我也在运行 resharper,所以我得到了额外的 resharper 运行程序,这就是 Auto 用来运行它的东西。
你的机器上真的安装了 nUnit 吗?在这种情况下,您可以测试该过程的成功程度,而无需 VS 和 Specflow-addin 的干扰。如果没有,良好的安装可能会为您提供所需的跑步者。
或者,我使用 nCrunch 自动运行所有测试。过去几个月我一直在多个解决方案上运行 nunit/specflow ,没有出现任何问题。那么根本不需要右键单击。 :-)
Like Ryan I also have no test runner specifically for Nunit. However since I'm also running resharper I get additional resharper runners, and that is what Auto uses to run it.
Have you actually got nUnit installed on your machine? In which case you can test how successful the process is without VS and Specflow-addin getting in the way. If not, well installing may give you the runner you need.
Alternatively, I use nCrunch to automatically run all my tests. I've had it running nunit/specflow for the last few months on multiple solutions with no issues. No need to right click at all then. :-)
SpecFlow 本身不提供测试运行程序,如果您想右键单击 .feature 并运行它,则必须重新配置 SpecFlow 以使用 MSTest,后者应使用内置 VS 运行程序。
如果您想使用 NUnit,则需要额外的工具。我推荐 Resharper,但它不是免费的。查看这篇文章 了解从 VS 运行 NUnit 测试的更多选项。
SpecFlow itself does not provide a test runner and if you want to right click on the .feature and run it, you'll have to re-configure SpecFlow to use MSTest, which should use built-in VS runner.
If you want to use NUnit, then additional tools are required. I would recommend Resharper, but it's not free. Check out this article for more options to run NUnit tests from VS.
再会。要调试,我执行以下操作:
希望有帮助
Good day. To debug i do the following :
Hope that helps