Before creating a new project, make sure that you've done the initial setup. |
Configuration:
test-project/ features/ demo feature.feature src/ test/ resources/ properties/ default.properties cucumber.xml ctf.properties pom.xml |
test-project/ ctf-source/ ctf-source.jar ... |
Your project is now ready to be executed. And you can also e.g. add it to your Git repo.
Make sure that the cucumber-java plugin is active in IntelliJ. Also make sure the Ruby plugin is NOT active (when you have that plugin). With the current versions of the plugins, there are compatibility problems. We expect these to be resolved in the future. You can check the plugins via File -> Other Settings -> Configure Plugins or via File -> Settings -> Plugins. |
Make sure that the SAHI proxy is running and Firefox (or your other preferred; configurated browser) is not runing
To execute a feature:
When all goes well, you get all the necessary feedback within IntelliJ.
Typically, when running features; IntelliJ should automaticaly fill in the Glue directory. When working with IntelliJ 13 however, this sometimes seems to fail, for all feature steps resulting in the message 'step undefined'. Alternatively, Cucumber may fail to recognize custom cuke packages that are not part of the general com.foreach.cuke.ctf package. These solutions to these two related issues are discussed below.
If this issue presents itself, do the following: at the top right of the IntelliJ window, choose 'Edit configuration' after clicking the dropdown box.
Under 'Defaults', fill in the Glue package: com.foreach.cuke.ctf, and press 'OK'. This should resolve the issue.
Additionally, it's also possible to do this for separate features, which will be available above 'Defaults' once the feature in question has been run at least once: for the feature, select the Deployment' tab, fill in the Glue package: com.foreach.cuke.ctf, and press 'OK'.
Taking restobookings' tablemanager as an example, do the following: