How to setup cucumber-jvm on eclipse - beginners guide needed

11,315 views
Skip to first unread message

Bradley Symons

unread,
Feb 9, 2012, 5:01:09 AM2/9/12
to Cukes
Hi

Im trying to setup, of find any relevant information on how to setup
cucumber-jvm on eclipse.
I am fairly new to Java, and Eclipse, I am Ruby background using
Rubymine and Cucumber.

I have installed the jars, and added them to the class path.

My question now is, do I create a Java project?
How do I get the pom.xml and how do I install it?

Is there anyway to pull down the example projects from Maven central,
with the example java features etc, calculator etc.

When I create a java project now, it just creates a src folder, I
looked at the screenshots on this page:
http://www.ludeke.net/2011_10_01_archive.html

Do I need a similar file structure with the src/main/test etc...?

Im a complete newbie to this, but I want to get started, any help,
information very much appreciated.

Thanks

aslak hellesoy

unread,
Feb 9, 2012, 5:10:45 AM2/9/12
to cu...@googlegroups.com
On Thu, Feb 9, 2012 at 10:01 AM, Bradley Symons <snomy....@gmail.com> wrote:
> Hi
>
> Im trying to setup, of find any relevant information on how to setup
> cucumber-jvm on eclipse.
> I am fairly new to Java, and Eclipse, I am Ruby background using
> Rubymine and Cucumber.
>
> I have installed the jars, and added them to the class path.
>
> My question now is, do I create a Java project?
> How do I get the pom.xml and how do I install it?
>

Try this: http://blogs.sourceallies.com/2011/06/maven-3-tutorial-project-setup/3/

> Is there anyway to pull down the example projects from Maven central,
> with the example java features etc, calculator etc.
>

I recommend you check out the source code from git:

https://github.com/cucumber/cucumber-jvm

Just install git and run `git://github.com/cucumber/cucumber-jvm.git`
Try out some of the projects in the examples folder.

More info here: http://help.github.com/

> When I create a java project now, it just creates a src folder, I
> looked at the screenshots on this page:
> http://www.ludeke.net/2011_10_01_archive.html
>
> Do I need a similar file structure with the src/main/test etc...?
>
> Im a complete newbie to this, but I want to get started, any help,
> information very much appreciated.
>

Hopefully the links above will get you started. Let us know if you
have more questions.

Aslak

> Thanks
>
> --
> 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 http://groups.google.com/group/cukes?hl=en.
>

Thomas Sundberg

unread,
Feb 10, 2012, 2:22:58 AM2/10/12
to cu...@googlegroups.com

I wrote an example a while a go that might give some ideas:
http://thomassundberg.wordpress.com/2011/09/16/test-drive-an-implementation-using-an-executable-specification/

HTH
Thomas

--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

Miguel Almeida

unread,
Feb 10, 2012, 4:31:41 AM2/10/12
to cu...@googlegroups.com


On Thursday, February 9, 2012 10:10:45 AM UTC, Aslak Hellesøy wrote:
On Thu, Feb 9, 2012 at 10:01 AM, Bradley Symons <snomy....@gmail.com> wrote:
> Hi
>
> Im trying to setup, of find any relevant information on how to setup
> cucumber-jvm on eclipse.
> I am fairly new to Java, and Eclipse, I am Ruby background using
> Rubymine and Cucumber.
>
> I have installed the jars, and added them to the class path.
>
> My question now is, do I create a Java project?
> How do I get the pom.xml and how do I install it?
>

Try this: http://blogs.sourceallies.com/2011/06/maven-3-tutorial-project-setup/3/

Bradley: this tutorial will install m2e, which is Maven's plugin in Eclipse. The goal of Aslak suggestion is to use Maven for your projects (hah! I can't believe that Aslak! ;)). Which means you should spend 30 minutes reading about what Maven is and what it can help you with (hint: in your case - and as a first approach to maven - it is a great way to help you manage dependencies).

After that it should be easier to follow the guide and set up Cucumber.

Miguel Almeida

Bradley Symons

unread,
Feb 10, 2012, 10:28:28 AM2/10/12
to Cukes
Hi

Thanks for your help, I managed to install maven successfully.
Im now writing feature files and steps.
Just need to work on my java skills now.

But thanks for the information.

One question is, within Eclipse I can run the tests by using JUnit,
which gives all green.

If I run maven build, for one feature file with one assertion, I
receive the following:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running net.ludeke.example.FuelCarTest

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.377
sec

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0


Why are there 4 tests? Any ideas?

aslak hellesoy

unread,
Feb 10, 2012, 11:28:07 AM2/10/12
to cu...@googlegroups.com

Cucumber-JVM creates a hierarchy of JUnit tests, where each leaf is a
step. That's why.

Aslak

Bradley Symons

unread,
Feb 13, 2012, 5:15:54 AM2/13/12
to Cukes
I have one more question, I read various things to get a nice report
genereated using Ant etc, what would you recommend as being the best
report configuration/plugin to be used for Cucumber.

I really like the html report layout generated with Ruby/Cucumber.

Marty Bradley

unread,
Jul 25, 2013, 5:50:35 PM7/25/13
to cu...@googlegroups.com
I just posted a video to my blog to walk through the setup for Cucumber-JVM http://bradasphere.com/?p=235

Jayasree prasad

unread,
Feb 6, 2014, 5:53:21 PM2/6/14
to cu...@googlegroups.com
Hi,

I have followed this link to setup on eclipse everything worked fine, but when I have created the feature file it is by default pointing to word file and later it turns to asci code, some how in the video it is pointing to text editor. Do i need to do install any plugins

Javix

unread,
Feb 7, 2014, 3:05:35 AM2/7/14
to cu...@googlegroups.com


On Thursday, 6 February 2014 23:53:21 UTC+1, Jayasree prasad wrote:
Hi,

I have followed this link to setup on eclipse everything worked fine, but when I have created the feature file it is by default pointing to word file and later it turns to asci code, some how in the video it is pointing to text editor. Do i need to do install any plugins

Abhay Bharti

unread,
Feb 7, 2014, 3:24:35 AM2/7/14
to cu...@googlegroups.com
You can refer blog to get steps to setup Cucumber-JVM - http://tester-learning.blogspot.in/2014/02/working-with-selenium-webdriver-and.html

Roberto Lo Giacco

unread,
Feb 7, 2014, 4:40:14 AM2/7/14
to cu...@googlegroups.com
Il giorno giovedì 6 febbraio 2014 23:53:21 UTC+1, Jayasree prasad ha scritto:
Hi,

I have followed this link to setup on eclipse everything worked fine, but when I have created the feature file it is by default pointing to word file and later it turns to asci code, some how in the video it is pointing to text editor. Do i need to do install any plugins

There are a bunch of plugins to help you out with feature files editing and execution, yet none of them has got all the features: you will have to pick the one that best fits your needs.

Please note though that you do not need anything to actually use CucumberJVM, those plugins are meant to facilitate some tasks, but are definitely not necessary: what I would strongly advice instead is to use a build manager, like Maven.

I'm personally the developer of one of those Eclipse plugins, mine is called Natural and is available at https://github.com/rlogiacco/Natural/wiki
Reply all
Reply to author
Forward
0 new messages