Cucumber step snippets

The navigation through scenarios is very comfortable. A click on an undefined step displays the corresponding code snipppet. Unfortunately the keywords in the snippets are duplicated like this:

Then /^Then she should be at the 'users\/new' page$/ do
  pending
end

I'd rather expect:

Then /^she should be at the 'users\/new' page$/ do
   pending
end

Hubert

5 comments
Comment actions Permalink

Hello Hubert,

Unfortunately the keywords in the snippets are duplicated like this:

Then /^Then she should be at the 'users\/new' page$/ do
  pending
end

I suppose you see in in console, right? It's Cucumber's output and their bug.

Do you know about our Quick fix for creating step definitions?

1. Just press Alt+Enter on undefined step
Screen shot 2009-09-19 at 15.50.51.png
2. Select "Create Step Definition"
3. And choose step definition file
Screen shot 2009-09-19 at 15.51.05.png

0
Comment actions Permalink

Hi Roman,

yes, in the console. I'm not sure about the origin of this keyword duplication since I get the correct snippets from cucumber itself outside of  RubyMine (using the terminal). For example:


You can implement step definitions for undefined steps with these snippets:

When /^she goes to \/signup$/ do
  pending
end



[...]

Thanks for the tip!

0
Comment actions Permalink

Hubert,

since I get the correct snippets from cucumber itself outside of  RubyMine (using the terminal). For example:

Thanks, I will check it. Our cucumber formatter uses cucumber api for creating these snippets, probably smth changed.

Update: I've fixed it, fix will be available in next EAP

0
Comment actions Permalink

I am not getting that "Choose Step Definition File" pop up. I am using IntelliJ Ultimate 2017.3 Version... Can you give us steps what makes it come?? in our company some people are getting that pop up but not me... what am I missing??

 

I have already created a step Definition file under src/java/stepdefinition... Let me know if you need any further information.

0
Comment actions Permalink

As per your Step 3 in above I am NOT Getting that.

0

Please sign in to leave a comment.