serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
179 stars 292 forks source link

Include example of how to execute test runner as an executable jar #32

Open johndeverall opened 4 years ago

johndeverall commented 4 years ago

Sometimes it is helpful to be able to run a test suite as an executable jar on a machine with only a JVM and no maven or other tooling installed.

Can you please provide an example of how to do this?

I imagine it is as simple as running the appropriate test runner somehow. For example:

public static void main(String args[]) {
  org.junit.runner.JUnitCore.main("junitfaq.SimpleTest");
}

Is there a Serenity with Cucumber equivalent?

wakaleo commented 4 years ago

This is actually very hard to do - there is no trivial way of doing it in.

johndeverall commented 4 years ago

Thanks for that. Forgive the question, but is there are non-trivial way of doing it? I'm prepared to put in a bit of effort to achieve it. What would be the steps? Could I drive it from say a JUnit5 Console Launcher or would that inadvertently drop the Serenity bits and pieces?

https://mkyong.com/junit5/junit-5-consolelauncher-examples/

I'm curious what the steps would be.