有没有办法在 Eclipse 中直接生成步骤定义而不运行 Cucumber?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30138833/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a way to directly generate Step Definitions in Eclipse without Running Cucumber?
提问by Dude
Im doing integration testing with cucumber and Gradle in Eclipse.
我在 Eclipse 中使用 Cucumber 和 Gradle 进行集成测试。
For now my workflow is
现在我的工作流程是
- Write a feature file
- Run it to generate step skeletons
- Copy and implement them
- 写一个特征文件
- 运行它以生成步骤骨架
- 复制并实施它们
This works good for new features and so on, but becomes quite bothersome if you have a large feature and implement new steps in the middle or towards the end. To get the new step skeletons I need to run the whole feature.
这适用于新功能等,但如果您有一个大功能并在中间或最后实施新步骤,则会变得非常麻烦。要获得新的步骤骨架,我需要运行整个功能。
Even with the
即使与
dryRun = true
option this takes up a long time.
选项这需要很长时间。
I have heard that IntellyJ can generate these step skeletons directly and I would like to know if something like this is possible in Eclipse?
我听说 IntellyJ 可以直接生成这些步骤骨架,我想知道在 Eclipse 中是否可以实现这样的功能?
回答by ItsMe-Rodders
Not for Eclipse, but it might prove helpful to you as a stop gap: https://chrome.google.com/webstore/detail/tidy-gherkin/nobemmencanophcnicjhfhnjiimegjeo
不适用于 Eclipse,但它可能证明对您有帮助作为一个停止间隙:https: //chrome.google.com/webstore/detail/tidy-gherkin/nobemmencanophcnicjhfhnjiimegjeo
It's capable of generating Java step defs from the text you paste into the editor. Hope it helps in some way while you await an answer for Eclipse.
它能够从您粘贴到编辑器中的文本生成 Java 步骤定义。希望它在您等待 Eclipse 答案时以某种方式有所帮助。
回答by CrazyRyu
Yes there is a nice plugin for Eclipse that also has even more benefits: Cucumber PeopleThe only Problem I got is, that it checks the steps after every save in the Cucumber console.
是的,Eclipse 有一个很好的插件,它还有更多好处:Cucumber People我遇到的唯一问题是,它在每次保存 Cucumber 控制台后都会检查步骤。
I also used the Natural pluginbefore.
我之前也用过Natural 插件。
回答by user1559625
Why is this a problem in Eclipse? If the feature file is big, then you only copy the modified scenario to a new feature file, and generate steps based on the new feature file.
为什么这是 Eclipse 中的问题?如果特征文件很大,那么您只需将修改后的场景复制到新的特征文件中,并根据新的特征文件生成步骤。