Re: [Cucumber] [JVM] Eclipse Plugin for Cucumber JVM in early dev - please test

3,448 views
Skip to first unread message

aslak hellesoy

unread,
Aug 21, 2012, 7:49:48 AM8/21/12
to cu...@googlegroups.com
On Mon, Aug 20, 2012 at 10:54 PM, MrPotes <m...@potes.org.uk> wrote:
> Hi all,
>
> If anyone is interested, I have started writing a Cucumber JVM plugin for
> Eclipse.
>

Hi James,

That's awesome! It would be great if the github project had some
screenshots to demo what the plugin is capable of.

Cheers,
Aslak

> It currently provides:
> - Basic syntax highlighting for .feature files
> - Step definition Auto-complete in .feature files
> - Right-click Run-As for .feature files
>
> The update site is: http://mrpotes.github.com/cukes-jvm-eclipse-plugin/
>
> Cheers,
> James
>
> --
> -- Rules --
>
> 1) Please prefix the subject with [Ruby], [JVM] or [JS].
> 2) Please use interleaved answers
> http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
> 3) If you have a question, don't reply to an existing message. Start a new
> topic instead.
>
> You received this message because you are subscribed to the Google Groups
> Cukes group. To post to this group, send email to cu...@googlegroups.com. To
> unsubscribe from this group, send email to
> cukes+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/cukes?hl=en
>
>

Vladimir Sapozhnik

unread,
Aug 21, 2012, 11:19:19 AM8/21/12
to cu...@googlegroups.com
Can you also translation of colors from ANSI colors to whatever Eclipse console uses for colors?

Thank you,

Vladimir Sapozhnik

On Mon, Aug 20, 2012 at 5:54 PM, MrPotes <m...@potes.org.uk> wrote:
Hi all,

If anyone is interested, I have started writing a Cucumber JVM plugin for Eclipse.

Robert

unread,
Aug 21, 2012, 11:56:57 AM8/21/12
to cu...@googlegroups.com


On Monday, August 20, 2012 2:54:39 PM UTC-7, MrPotes wrote:
Hi all,

If anyone is interested, I have started writing a Cucumber JVM plugin for Eclipse.

It currently provides:
- Basic syntax highlighting for .feature files
- Step definition Auto-complete in .feature files
- Right-click Run-As for .feature files


Cheers, 
James


Very cool!! Sorry for the silly question, but how would I install this ? 

MrPotes

unread,
Aug 21, 2012, 5:04:56 PM8/21/12
to cu...@googlegroups.com

On Tuesday, 21 August 2012 16:56:57 UTC+1, Robert wrote:

Very cool!! Sorry for the silly question, but how would I install this ? 

Hi Robert,

In Eclipse 3.7+:
- Help -> Install new software...
- Paste the update site URL in
- For some reason, categorization isn't working right, so you may need to deselect "Group items by category"

Cheers,
James

MrPotes

unread,
Aug 21, 2012, 5:06:13 PM8/21/12
to cu...@googlegroups.com

On Tuesday, 21 August 2012 16:19:19 UTC+1, Vladimir Sapozhnik wrote:
Can you also translation of colors from ANSI colors to whatever Eclipse console uses for colors?

I confess I don't really know what you mean by this - for the syntax highlighting, I've just followed the Eclipse example.

Cheers,
James 
 

Vladimir Sapozhnik

unread,
Aug 21, 2012, 5:13:22 PM8/21/12
to cu...@googlegroups.com
I meant when running cuke to show colors (Green for successful run of a step, Red for unsuccessful, Blue for skipped step, and Brown for undefined step, and whatever other variations).  If you run cuke in terminal it outputs steps with ANSI escape sequences and Unix terminal substitutes ANSI sequences with color, but if you run a feature within Eclipse, Eclipse doesn't know how to translate ANSI sequences.  There is an app for Windows to do it (Ansicon another Wac) that might help you to see how to deal with those ANSI escape sequences.

Vladimir 


Cheers,
James 
 

--

MrPotes

unread,
Aug 21, 2012, 5:23:08 PM8/21/12
to cu...@googlegroups.com


On Monday, 20 August 2012 22:54:39 UTC+1, MrPotes wrote:
Hi all,

If anyone is interested, I have started writing a Cucumber JVM plugin for Eclipse.

It currently provides:
- Basic syntax highlighting for .feature files
- Step definition Auto-complete in .feature files
- Right-click Run-As for .feature files

I've found the the Right-click run-as isn't working in Eclipse 4.2. It works (at least for me) in Eclipse 3.7, I will try to update when I know what versions it works in.

Aslak, I'll try and post some screenshots soon. Currently the i18n doesn't work (English only for now) - I'd like to get that to work, but haven't yet if/how I can use the existing cucumber stuff for working out language, as I start from the java step definitions rather than from a .feature file. There are a couple of questions I could do with some help with:

- Are the language annotations generated?
- Can I cross languages, for example can I use step defined as @cucumber.annotation.fr.Et("...") in an English .feature file following a Given statement as an And step?
- (not quite related, but...) are there any licence restrictions on the Cucumber images/icons, or can I use them, particularly the cukes.info favicon?

Cheers,
James

MrPotes

unread,
Aug 21, 2012, 5:29:33 PM8/21/12
to cu...@googlegroups.com
Ah, I see. It would definitely be nice to link the editor to the run result - I wondered about about line backgrounds being coloured for the result (your colours sound as good as any), in much the same way as if you use EclEmma for example (see http://www.eclemma.org/index.html).

I'll add this to the TODO list :-)

Cheers,
James

aslak hellesoy

unread,
Aug 22, 2012, 2:32:57 AM8/22/12
to cu...@googlegroups.com
On Tue, Aug 21, 2012 at 10:13 PM, Vladimir Sapozhnik <savl...@gmail.com> wrote:
> I meant when running cuke to show colors (Green for successful run of a
> step, Red for unsuccessful, Blue for skipped step, and Brown for undefined
> step, and whatever other variations). If you run cuke in terminal it
> outputs steps with ANSI escape sequences and Unix terminal substitutes ANSI
> sequences with color, but if you run a feature within Eclipse, Eclipse
> doesn't know how to translate ANSI sequences. There is an app for Windows
> to do it (Ansicon another Wac) that might help you to see how to deal with
> those ANSI escape sequences.
>
> Vladimir
>

Vladimir, James,

When Cucumber-JVM is run from an IDE such as Eclipse, the IDE plugin
would most likely instruct Cucumber-JVM to use an IDE-specific
formatter.
This would be a formatter that would communicate the results straight
back to the IDE, which in turn would display the results "natively".
The formatter API doesn't expose colours (colours are an
implementation detail of the pretty formatter, which would typically
not be used when run inside an IDE).

If Cucumber-JVM is run in a separate JVM from the IDE itself, the
IDE-specific formatter could "phone home" to the IDE over a TCP
socket.

Of course, it would be ideal if the user could *also* specify other
command line arguments, for example:

--strict --format pretty --format json:cucumber.json

The IDE would then just append its own formatter before running:

--strict --format pretty --format json:cucumber.json --format
potes.cucumberjvm.formatter.EclipseFormatter:98768

Cucumber-JVM would then report as usual (in addition to "phoning
home"), and in this case, pretty format going to STDOUT would indeed
have ANSI colours, and Eclipse would have to try to display those
correctly in its built-in console. I would expect however that
interpreting ANSI escapes in the Eclipse console should be done in
Eclipse "core" and not in the Cucumber-JVM plugin.

I hope this clarifies a little. James - in case you hadn't looked -
see https://github.com/cucumber/cucumber-jvm/wiki/IDE-support for a
more comprehensive wish list.

Aslak

aslak hellesoy

unread,
Aug 22, 2012, 2:43:26 AM8/22/12
to cu...@googlegroups.com
On Tue, Aug 21, 2012 at 10:23 PM, MrPotes <m...@potes.org.uk> wrote:
>
>
> On Monday, 20 August 2012 22:54:39 UTC+1, MrPotes wrote:
>>
>> Hi all,
>>
>> If anyone is interested, I have started writing a Cucumber JVM plugin for
>> Eclipse.
>>
>> It currently provides:
>> - Basic syntax highlighting for .feature files
>> - Step definition Auto-complete in .feature files
>> - Right-click Run-As for .feature files
>
>
> I've found the the Right-click run-as isn't working in Eclipse 4.2. It works
> (at least for me) in Eclipse 3.7, I will try to update when I know what
> versions it works in.
>
> Aslak, I'll try and post some screenshots soon. Currently the i18n doesn't
> work (English only for now) - I'd like to get that to work, but haven't yet
> if/how I can use the existing cucumber stuff for working out language, as I
> start from the java step definitions rather than from a .feature file.

"I start from" does that mean you are triggering a run from a java
step definition file?
If that's the case I would strongly recommend you remove this feature,
as it seems to encourage feature-coupled steps:
https://github.com/cucumber/cucumber/wiki/Feature-Coupled-Steps-(Antipattern)

Step definitions are meant to be reusable across many scenarios in
many feature files. It doesn't make sense to run from a stepdef class.

> There
> are a couple of questions I could do with some help with:
>
> - Are the language annotations generated?

Yes they are:
https://github.com/cucumber/cucumber-jvm/blob/v1.0.14/java/pom.xml#L55-91

> - Can I cross languages, for example can I use step defined as
> @cucumber.annotation.fr.Et("...") in an English .feature file following a
> Given statement as an And step?

Non tu ne can not :-) The gherkin parser would treat this as a syntax error.
Gherkin has one parser for each i18n language. It uses En by default,
but this can be overridden with a comment in the header of the
.feature file:

# language: fr

If your plugin depends on the gherkin jar you should be able to use
the I18n class at runtime to figure out keywords for various
languages. It's nice to avoid code generation when possible.

> - (not quite related, but...) are there any licence restrictions on the
> Cucumber images/icons, or can I use them, particularly the cukes.info
> favicon?

I don't think I have explicitly licensed the images, but I intend to
license them under creative-commons. Just go ahead and use what you
can find. Maybe one day I'll create a "logos and icons" page where
it's easier to find.

Keep up the good work!

MrPotes

unread,
Aug 22, 2012, 6:16:31 AM8/22/12
to cu...@googlegroups.com


On Wednesday, August 22, 2012 7:43:26 AM UTC+1, Aslak Hellesøy wrote:
On Tue, Aug 21, 2012 at 10:23 PM, MrPotes <m...@potes.org.uk> wrote:
>
>
> On Monday, 20 August 2012 22:54:39 UTC+1, MrPotes wrote:
>>
>> Hi all,
>>
>> If anyone is interested, I have started writing a Cucumber JVM plugin for
>> Eclipse.
>>
>> It currently provides:
>> - Basic syntax highlighting for .feature files
>> - Step definition Auto-complete in .feature files
>> - Right-click Run-As for .feature files
>
>
> I've found the the Right-click run-as isn't working in Eclipse 4.2. It works
> (at least for me) in Eclipse 3.7, I will try to update when I know what
> versions it works in.
>
> Aslak, I'll try and post some screenshots soon. Currently the i18n doesn't
> work (English only for now) - I'd like to get that to work, but haven't yet
> if/how I can use the existing cucumber stuff for working out language, as I
> start from the java step definitions rather than from a .feature file.

"I start from" does that mean you are triggering a run from a java
step definition file?
If that's the case I would strongly recommend you remove this feature,
as it seems to encourage feature-coupled steps:
https://github.com/cucumber/cucumber/wiki/Feature-Coupled-Steps-(Antipattern)

Step definitions are meant to be reusable across many scenarios in
many feature files. It doesn't make sense to run from a stepdef class.

Sorry, no - that wasn't what I meant - I'll try again: In order to be able to do the auto-complete for step definitions, the classpath is scanned for annotated methods at plugin initialisation, and then resources are re-scanned if they are saved. The list of steps is then held in memory so that the classpath doesn't have to be rescanned every time auto-complete is requested.
 

> There
> are a couple of questions I could do with some help with:
>
> - Are the language annotations generated?

Yes they are:
https://github.com/cucumber/cucumber-jvm/blob/v1.0.14/java/pom.xml#L55-91

> - Can I cross languages, for example can I use step defined as
> @cucumber.annotation.fr.Et("...") in an English .feature file following a
> Given statement as an And step?

Non tu ne can not :-) The gherkin parser would treat this as a syntax error.
Gherkin has one parser for each i18n language. It uses En by default,
but this can be overridden with a comment in the header of the
.feature file:

# language: fr

If your plugin depends on the gherkin jar you should be able to use
the I18n class at runtime to figure out keywords for various
languages. It's nice to avoid code generation when possible.


Ok, cool - I can make that work.
 
> - (not quite related, but...) are there any licence restrictions on the
> Cucumber images/icons, or can I use them, particularly the cukes.info
> favicon?

I don't think I have explicitly licensed the images, but I intend to
license them under creative-commons. Just go ahead and use what you
can find. Maybe one day I'll create a "logos and icons" page where
it's easier to find.

Keep up the good work!


Thanks!

MrPotes

unread,
Aug 22, 2012, 6:28:53 AM8/22/12
to cu...@googlegroups.com


On Tuesday, August 21, 2012 6:28:03 PM UTC+1, Matt Pietal wrote:
On Monday, August 20, 2012 5:54:39 PM UTC-4, MrPotes wrote:
> Hi all,
>
>
> If anyone is interested, I have started writing a Cucumber JVM plugin for Eclipse.
>
>
> It currently provides:
> - Basic syntax highlighting for .feature files
> - Step definition Auto-complete in .feature files
> - Right-click Run-As for .feature files
>
>
> The update site is: http://mrpotes.github.com/cukes-jvm-eclipse-plugin/
>
>
> Cheers,
> James

Perhaps we could join forces: https://github.com/matthewpietal/Eclipse-Plugin-for-Cucumber

I have a few bugs to work out and some code to cleanup but seems we are on the same path.

Yes, sounds good. Perhaps Aslak might be willing to provide a repository within github.com/cucumber? There is also a Gherkin editor (doesn't integrate with Cucumber JVM steps so far as I can tell) at https://github.com/ilanpillemer/gherkin-eclipse-plugin (see https://groups.google.com/d/topic/cukes/zcCAbtXS0TI/discussion) which it might be nice to the editor, as I think it's further along with syntax highlighting.

If we do so, we probably ought to come up with a shared task list?

Cheers,
James

aslak hellesoy

unread,
Aug 22, 2012, 8:42:56 AM8/22/12
to cu...@googlegroups.com
On Tue, Aug 21, 2012 at 6:28 PM, Matt Pietal <matthew...@gmail.com> wrote:
> On Monday, August 20, 2012 5:54:39 PM UTC-4, MrPotes wrote:
>> Hi all,
>>
>>
>> If anyone is interested, I have started writing a Cucumber JVM plugin for Eclipse.
>>
>>
>> It currently provides:
>> - Basic syntax highlighting for .feature files
>> - Step definition Auto-complete in .feature files
>> - Right-click Run-As for .feature files
>>
>>
>> The update site is: http://mrpotes.github.com/cukes-jvm-eclipse-plugin/
>>
>>
>> Cheers,
>> James
>
> Perhaps we could join forces: https://github.com/matthewpietal/Eclipse-Plugin-for-Cucumber
>
> I have a few bugs to work out and some code to cleanup but seems we are on the same path.
>

I'd be happy to move a repo over to github.com/cucumber/eclipse-plugin
when you're ready.
If you want to do this it would be nice if the java packages were
renamed to cucumber.eclipse.*

Just let me know...

Cheers,
Aslak

aslak hellesoy

unread,
Aug 22, 2012, 8:43:17 AM8/22/12
to cu...@googlegroups.com
Gotcha. That sounds awesome!

Aslak

aslak hellesoy

unread,
Aug 29, 2012, 7:28:23 AM8/29/12
to cu...@googlegroups.com
On Wed, Aug 29, 2012 at 12:15 PM, Jeffrey Cameron
<jeffrey...@gmail.com> wrote:
> I have taken a look at both and I think your plugin is a bit more functional
> right now Matt, at least in Juno (4.2) where I'm working.
>
> Any thoughts to writing something that would auto format the tables?

If you implement table formatting, I would recommend doing it so that
numbers are right-adjusted and text is left-adjusted. That makes it
easier to read:

https://gist.github.com/3511091

Aslak

>
>
> On Tuesday, 21 August 2012 13:28:03 UTC-4, Matt Pietal wrote:
>>
>> On Monday, August 20, 2012 5:54:39 PM UTC-4, MrPotes wrote:
>> > Hi all,
>> >
>> >
>> > If anyone is interested, I have started writing a Cucumber JVM plugin
>> > for Eclipse.
>> >
>> >
>> > It currently provides:
>> > - Basic syntax highlighting for .feature files
>> > - Step definition Auto-complete in .feature files
>> > - Right-click Run-As for .feature files
>> >
>> >
>> > The update site is: http://mrpotes.github.com/cukes-jvm-eclipse-plugin/
>> >
>> >
>> > Cheers,
>> > James
>>
>> Perhaps we could join forces:
>> https://github.com/matthewpietal/Eclipse-Plugin-for-Cucumber
>>
>> I have a few bugs to work out and some code to cleanup but seems we are on
>> the same path.
>

Matt Pietal

unread,
Aug 30, 2012, 7:34:04 AM8/30/12
to cu...@googlegroups.com
On Wednesday, August 29, 2012 7:28:46 AM UTC-4, Aslak Hellesøy wrote:
On Wed, Aug 29, 2012 at 12:15 PM, Jeffrey Cameron
<jeffrey...@gmail.com> wrote:
> I have taken a look at both and I think your plugin is a bit more functional
> right now Matt, at least in Juno (4.2) where I'm working.
>
> Any thoughts to writing something that would auto format the tables?

If you implement table formatting, I would recommend doing it so that
numbers are right-adjusted and text is left-adjusted. That makes it
easier to read:

https://gist.github.com/3511091

Aslak

I agree that table formatting would be a great addition.  I have been using tables more and more for my tests.  And I definitely agree on text alignment.  Let me see what I can do.

Matt

Guilherme Meira Lins

unread,
Sep 27, 2012, 8:37:45 AM9/27/12
to cu...@googlegroups.com
The same happens to me...

I've installed the plugin and only the syntax highlight is working.

My environment:

Cucumber plugin   3.0.0.201207061105
Eclipse IDE for Java Developers
Version: Indigo Service Release 2
Build id: 20120216-1857

On Wednesday, 26 September 2012 12:34:10 UTC-4, Luk Lau wrote:
Is this the update site?


I have install the plugin (3.0.0.20120706) on the following Eclipse version:
The syntax highlight is working.
But rule hinting with ctrl+space does not seem to react.
Is there anything I have to config and tell eclipse where the feature files are located?

thanks a lot

Luc


plugin (3.0.0.20120706) 
Eclipse Java EE IDE for Web Developers
Version: Juno Release
Build id: 20120614-1722








On Friday, September 14, 2012 7:38:44 AM UTC-4, Simple tester wrote:
Hi James, 

 This plugin is something we were looking around for !! Great idea, I can't seem to find the update site.
 Could you please help.

Thanks
Simpletester

MrPotes

unread,
Sep 27, 2012, 8:41:46 AM9/27/12
to cu...@googlegroups.com
Hi Luc, Simpletester, Guilherme,

There are a few different plugins doing the rounds - that's a different one from the one I'm offering.

Please try:

Cheers.

Javix

unread,
Sep 28, 2012, 4:14:51 AM9/28/12
to cu...@googlegroups.com
Tried it on Eclipse Juno:


Version: Juno Release
Build id: 20120614-1722

No highlighting for foreign languages, just for English, may be it is in the future ? :)
No option proposed to create an empty feature (what is the case in Netbeans Cucumber plugin) from the internal menu, as we ususally do when creating a new class, package, etc. by hitting CTRL-N.

MrPotes

unread,
Sep 28, 2012, 4:27:29 AM9/28/12
to cu...@googlegroups.com
Hi Javix,

Yep, foreign language highlighting is on its way - I've got it working, but am just trying to figure out how to make eclipse re-evaluate the highlighting when you change the language declared.

I can't say that I had "New feature" high (or indeed existing) on my TODO list - I just do new file. I'm not convinced it's particularly useful - it would have to decide on a language for new feature files, and would actually only save you a few key combinations of typing in doing so. If you can tell me a bit more about the netbeans feature for doing so, I'll have a think about adding it at some point.

Cheers,
James

MrPotes

unread,
Sep 28, 2012, 5:34:42 PM9/28/12
to cu...@googlegroups.com
A new version, 0.2.0, of the plugin is now available. This includes multi-lingual syntax highlighting. This requires editor close/reopen if the language is changed, unfortunately. Hopefully that bug will be ironed out soon (https://github.com/mrpotes/cukes-jvm-eclipse-plugin/issues/9).

James

Javix

unread,
Oct 1, 2012, 8:06:10 AM10/1/12
to cu...@googlegroups.com
After update, the highlighting (at least for French) works  as expected. Thanks a lot, James.

Guilherme Meira Lins

unread,
Oct 2, 2012, 3:19:04 PM10/2/12
to cu...@googlegroups.com
Hi James,

I tried to install your plugin using your Update Site but I got the following error on my Eclipse:

Read timed out

Would happen to have the plugin files in an archived file so I can add it as a local archive in my eclipse?

BR,

Guilherme

James Phillpotts

unread,
Oct 2, 2012, 3:24:25 PM10/2/12
to cu...@googlegroups.com

Hi Guilherme,

The update site is just a github pages view of the gh-pages branch of the repository. You can download them direct from the github ui if your having problems with your eclipse.

Alternatively you should be able to retry - to have got as far as downloading the jar file you quote, eclipse must have already downloaded one XML file and the (eclipse) feature jar file.

Cheers
James

--

MrPotes

unread,
Mar 26, 2013, 5:24:48 AM3/26/13
to cu...@googlegroups.com
Hi,

If it's my plugin (from the original post of this thread) you've installed, to create a new feature file, just do a standard new file, specifying xyz.feature as the file name. Once you've written your scenarios and steps you can run the feature file by right clicking on either the editor or the file listing in a navigator/explorer view and selecting Run As... -> Cucumber Test.

Cheers,
James

Yvonne Li

unread,
Jul 30, 2013, 1:15:10 PM7/30/13
to cu...@googlegroups.com
Hi Matt,
I just installed your plug in to my eclipse 3.7 and need your help. In Eclipse, how can I view feature files with all the cucumber feature enabled? Could you please give me a detail instruction: start from Create project--which project should I choose? I chose java; then I opened the cucumber feature files. They don't show these nice things at all:
  • Syntax Highlighting
  • Validation: Scans your workspace for potential matching rules. Will give you a warning if no rule is found.
  • Rule suggestion: Type Given, When, Then, followed by CTRL+space to see all matching rules defined in your workspace.
  • Jump to defintion: For rules that match, hit F3 to jump to the Java code defined for that rule
Please help. Thanks.
Yvonne
Reply all
Reply to author
Forward
0 new messages