[英]Specflow "No Matching Step Definition Found" but also "All Steps have been defined already"
I am unable to run my Specflow tests, in Visual Studio 2022.我无法在 Visual Studio 2022 中运行我的 Specflow 测试。
I have all steps defined and bound and yet it still says "No Matching Step Definition Found".我已经定义并绑定了所有步骤,但它仍然显示“未找到匹配的步骤定义”。 Yet when I right click on the line and try to "Define Steps", it says "All Steps have been defined already"?.!然而,当我右键单击该行并尝试“定义步骤”时,它说“所有步骤都已经定义了”?。! So no purple lines etc.所以没有紫线等。
I am using我在用
I can't understand why??我不明白为什么?
Any help gratefully received and appreciated.任何帮助都感激不尽并表示赞赏。 I've been trying to figure this out for over a day now as it affects the other tests.一天多来我一直在努力解决这个问题,因为它会影响其他测试。
Sometimes Visual Studio and SpecFlow just act weird.有时 Visual Studio 和 SpecFlow 只是表现得很奇怪。 If a clean and rebuild doesn't fix the issue, close all Visual Studio windows, then delete the .vs
folder that resides at the root of your solution.如果清理和重建不能解决问题,请关闭所有 Visual Studio windows,然后删除位于解决方案根目录的.vs
文件夹。
I've noticed similar problems to this for years, and it usually indicates some mismatch between the C# step definitions, feature files, and the cached mapping between the two in Visual Studio.多年来我一直注意到与此类似的问题,它通常表示 C# 步骤定义、功能文件和 Visual Studio 中两者之间的缓存映射之间存在一些不匹配。
Failing that, if using Git, try a "super clean" of your working tree after committing all pending changes:否则,如果使用 Git,请在提交所有未决更改后尝试“超级清理”您的工作树:
git clean -fdx
And of course if that doesn't work, uninstalling and reinstalling the SpecFlow plugin might help too.当然,如果这不起作用,卸载并重新安装 SpecFlow 插件也可能有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.