IntelliJ与黄瓜(java)和步骤定义位置 [英] IntelliJ with cucumber (java) and step definition location

查看:166
本文介绍了IntelliJ与黄瓜(java)和步骤定义位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我正在使用IntelliJ开发项目并尝试利用其黄瓜功能。我没有使用黄瓜的java风格,但IntelliJ似乎想要相对于特征文件在特定位置的步骤定义文件。

Ok, so I'm working on a project using IntelliJ and trying to take advantage of its cucumber functionality. I've not worked with the java flavour of cucumber, but IntelliJ seems to want the step definition files in a specific location, relative to the feature files.

我发现了这个:如何在intelliJ 12中定义黄瓜的步骤定义位置和其他来源指出我能够添加我的运行配置的胶水属性,告诉cuke哪个包到找到步骤文件。所以我正处于可以通过IDEA运行测试的地步。但我每次运行新测试时都需要设置此项,因为Ctrl + Alt + F10或右键单击+运行测试不会以此标志启动测试。此外,由于IDEA不知道步骤的位置,它不会自动完成或按Ctrl +单击导航到步骤,因此ID支持被拧紧。

I found this: how to define step definitions location for cucumber in intelliJ 12 and other sources that pointed me to been able to add the "glue" property of my run configurations which tells cuke which package to find the step file. So I am at a point where I can run my tests via IDEA. BUT I need to set this every time I run a new test, as Ctrl+Alt+F10 or right click+run test will not start the test with this flag. Also, the ide support is screwed as IDEA doesn't know where the steps are, it doesn't auto complte or Ctrl+Click navigate to steps.

有没有办法让IDEA项目在运行测试和自动完成时始终查找给定包中的步骤?

Is there a way to the the IDEA project to always look for steps in a given package both when running the tests and for its auto complete?

推荐答案

为可能遇到此问题的其他人创建自我答案。我的项目没有标记为测试源根目录的步骤,虽然我做到了这一点,但直到我关闭并重新打开我的项目才得到它们。所以我的回答是一个简单的重启。

Creating self answer for others who might have this problem. My project did not have the steps marked as test source root, and although I DID do this, it was not until I closed and reopened my project that they were picked up. So a simple restart was my answer.

这篇关于IntelliJ与黄瓜(java)和步骤定义位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆