18

Im doing integration testing with cucumber and Gradle in Eclipse.

For now my workflow is

  1. Write a feature file
  2. Run it to generate step skeletons
  3. 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?

BuZZ-dEE
  • 6,075
  • 12
  • 66
  • 96
Dude
  • 692
  • 1
  • 4
  • 25
  • 1
    A simple solution would be to use tags to only run the scenarios you want to generate step definitions for. Also, and although it doesn't solve directly your problem, I recommend the [Natural plugin](https://github.com/rlogiacco/Natural/wiki) for Eclipse: it does provide lots of helpful features for Cucumber (like click-through from feature files). – Sébastien Le Callonnec May 21 '15 at 19:09
  • Yes I am using IntellyJ and I can generate step skeletons directly without dryrun – Pavan T May 03 '17 at 13:55
  • Sorry IntellyJ is not an option at my working place, but maybe you can provide an answer for other people which can use this – Dude May 03 '17 at 14:02
  • In IntelliJ you can generate a stepdefinitions by putting the cursor on the step to be defined in the feature file and clicking `Alt` + `Enter`. This will give you the option to generate the selected step, or all steps in the feature file. Eclipse might have something similar. Have you tried the following: https://cucumber.github.io/cucumber-eclipse//2016/03/28/New-StepDefinition-File-Wizard.html – Marit Jan 11 '18 at 09:46

3 Answers3

13

Not for Eclipse, but it might prove helpful to you as a stop gap: 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.

ItsMe-Rodders
  • 291
  • 2
  • 4
  • This looks like a nice gap filler, i will try it out. Is this your programm? is the source available anywhere? I will not accept the answer for now, because i hope that someone can help me with eclipse – Dude May 15 '15 at 06:07
  • It is my program, yes. It's not open source at the moment - something I'm looking at though. – ItsMe-Rodders May 19 '15 at 07:31
  • thx maybe you can give me a note when you decide to put it opensource – Dude May 20 '15 at 12:53
  • Hi, any chance for make it open source? I totally love it, but need some improvement to be able to use it for our tests (localization and diacritics for non english scenarios) – mefi Mar 03 '16 at 11:30
0

Yes there is a nice plugin for Eclipse that also has even more benefits: Cucumber People The only Problem I got is, that it checks the steps after every save in the Cucumber console.

I also used the Natural plugin before.

  • after some testing i see, that it can do what i want in a very limited way. it has problem with regular expressions and step finding. I also cannot add step definitions to existing step files, it always wants to add new step files. hope this plugin will mature in the future versions, because it looks very promising! – Dude Dec 08 '15 at 16:26
  • does any one have updated link for plugin 'Cucumber People'? Current link doesn't seems to be working. – Amit Sep 16 '16 at 21:09
0

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.

user1559625
  • 2,583
  • 5
  • 37
  • 75