简体   繁体   English

Specflow“未找到匹配的步骤定义”而且“所有步骤都已定义”

[英]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我在用

  • VS 2022 VS 2022
  • Specflow 3.9.74规格流 3.9.74
  • Specflow.MSTest 3.9.74 Specflow.MSTest 3.9.74
  • Specflow.Tools.MsBuild.Generation 3.9.74 Specflow.Tools.MsBuild.Generation 3.9.74

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.一天多来我一直在努力解决这个问题,因为它会影响其他测试。

Added screenshot here在此处添加了屏幕截图截屏

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.

相关问题 “找到多个定义的符号”我的析构函数是如何被定义两次的? - "multiply defined symbols found" how is my destructor being defined twice? 您如何修复 Visual Studio 以便它可以检测代码中的错误并在智能感知中显示所有选项? - How do you fix Visual studio so it can detect errors in code and also show all options in the intellisense? 如何在 Visual Studio 2022 中解决此问题“当前不会命中断点。没有为此文档加载任何符号” - How to fix this issue "The breakpoint will not currently be hit. No symbols have been loaded for this document" in Visual Studio 2022 Specflow+ Xunit 在 visual studio 中运行每个案例两次 - Specflow+ Xunit Running every case twice in visual studio 找不到资源样式,即使我已经将其删除并且未在 Styles.xml 中使用 - Resource style not found even though I already remove it and not using in Styles.xml 折叠/展开被认为是撤消/重做“步骤” - Folding/unfolding considered an undo/redo "step" 即使在指定共享 dll 之后,MFC 应用程序也无法构建项目? 网上找的方法都试过了还是不行 - MFC application failing to build project even after shared dll specified? I tried all the ways I found on online but it still doesn't work Visual Studio 2022 git 错误无法与 {0} 端口 {1} 协商:找不到匹配的主机密钥类型。 他们的提议:ssh-rsa - Visual Studio 2022 git error Unable to negotiate with {0} port {1}: no matching host key type found. Their offer: ssh-rsa 在 VS2022 中找不到 SpecFlow Feature.cs 文件选项 - Could not find SpecFlow Feature .cs Files option in - VS2022 “填写:SelectCommand.Connection 属性尚未初始化。” - 'Fill: SelectCommand.Connection property has not been initialized.'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM