问题描述
我在外部程序集中具有绑定(根据specflow文档此处)
我们需要这个,因为我们正在构建一个通用的步骤定义库,该库可以在我们的任何测试套件中使用.
它可以工作,但是某些specflow功能似乎不起作用.
即:
所有步骤都以紫色突出显示(指示它无法与绑定匹配)
如果选择一个步骤并单击F12或右键单击并选择转到步骤定义",则表示找不到匹配的绑定.
但是,代码运行正常,并且如果您对其进行调试,则可以从功能文件进入步骤定义文件,因此看来问题仅在于Specflow插件,而不是nuget包?
有人知道如何解决此问题吗?
我在视频此处上载了测试SLN.
I have bindings in an external assembly (As per the specflow docs here)
We need this, as we are making a generic library of Step Definitions that can be used in any of our test suites.
It works, however some specflow functionality does not appear to work.
Namely:
All steps are highlighted purple (Indicating that it cannot be matched with a binding)
If you select a step and hit F12 or right-click and select "Go To Step Definition", it says it cannot find a matching binding.
However, the code runs OK, and if you debug it, you can step from the feature file into the step definition file, so it appears that the problem is only with the Specflow plugin, not with the nuget package?
Does anyone know how to fix this?
I uploaded the test SLN used in the video here.
推荐答案
您需要清除Temp文件夹中的SpecFlow .cache文件.
You need to clear your SpecFlow .cache file in your Temp folder.
在Windows资源管理器中,转到%TEMP%,然后找到并删除您的.cache文件.它将具有"specflow-stepmap- [项目名称] .cache"模式.重新启动Visual Studio,将重新计算定义并创建一个新的.cache.
In Windows Explorer, go to %TEMP% and then locate and delete your .cache file. It will have a pattern of "specflow-stepmap-[projectname].cache". Restart Visual Studio and the definitions will be recalculated and a new .cache will be created.
这篇关于来自外部装配的Specflow绑定始终为紫色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!