[JVM]- How to run the Cucumber Tests from a main method?

1,365 views
Skip to first unread message

sivachithambaram rangaraj

unread,
Dec 16, 2013, 4:13:46 PM12/16/13
to cu...@googlegroups.com
Hi,

Please let me know how to run the Cucumber tests from a main method.

Also is there a option to send  a configurable list t of features to execute. Instead of executing all the features.


Thanks
Siva

Paolo Ambrosio

unread,
Dec 16, 2013, 4:44:19 PM12/16/13
to cu...@googlegroups.com
On Mon, Dec 16, 2013 at 9:13 PM, sivachithambaram rangaraj
<sivachit...@gmail.com> wrote:

> Hi,
>
> Please let me know how to run the Cucumber tests from a main method.

Hi Siva,

Why do you want to write a different runner for Cucumber? Can't you
use the command line interface (cucumber.api.cli.Main) that has a main
method already?


Paolo
Message has been deleted

Paolo Ambrosio

unread,
Dec 17, 2013, 2:29:17 AM12/17/13
to cu...@googlegroups.com
Please read the rules of this group and do not top post.

On Mon, Dec 16, 2013 at 10:26 PM, sivachithambaram rangaraj
<sivachit...@gmail.com> wrote:

> Actually i have an exisiting Automation framework which reads all the
> testcases in YAML format and executes them from a main method.
>
>
> I am trying to use cucumber instead of the YAML. So i need to setup lot of
> framework related stuff before start executing the actual tests. So i will
> not be able to use the Cucumber,api.cli,Main

You can still create the command line parameters and call the
cucumber.api.cli.Main.main method. As the command line is unlikely to
change, it might be the safest option for you.

> Also please let me know if ther is an way to pass list of configurable
> features from the java class.

Do you mean a list of features? If you run the main method with the
--help flag you will be prompted with this message, explaining you how
to use it:

https://github.com/cucumber/cucumber-jvm/blob/master/core/src/main/resources/cucumber/runtime/USAGE.txt
> --
> -- 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cukes+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages