如何在测试运行时报告 SpecFlow 场景?
我已经设法调整 SpecFlow 测试的输出,使其可读性良好,仅报告步骤和失败。但如果没有报告功能和场景名称,它仍然很难读。
查看生成的代码,功能和场景名称似乎被编码为 NUnit DescriptionAttributes。
我可以配置 SpecFlow 或 NUnit 将这些报告也报告给标准输出,以便获得流畅的“故事式”输出吗?
I've managed to tune the output from my SpecFlow tests so that it reads nicely, with just the steps reported plus failures. But it's still pretty unreadable without the Feature and Scenario names also being reported.
Looking at the generated code, it appears that the Feature and Scenario names are encoded as NUnit DescriptionAttributes.
Can I configure SpecFlow or NUnit to also report these to stdout, so I get a nicely flowing "story-like" output?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在步骤定义类中定义了一个额外的方法,如下所示,那么 NUnit 将报告功能和场景文本。
我希望这有帮助。
If you define an extra method in your step definition class as follows then NUnit will report the feature and scenario text.
I hope this helps.