Run a single cucumber scenario from an executable JAR
<p>I would like to package my acceptance tests into an executable JAR where all necessary libraries are included for running the tests and generating the reports. I would also like to either run all tests or a single test.</p>

<p>So far, I'm able to run all tests and although reports are being generated in the location I specified in serenity.properties, the index.html is NOT being generated.</p>

<p>Normally, I would run my tests using maven verify goal which would run the serenity-maven-plugin, but since I'm running from a JAR, I'm not sure how I can achieve the same thing.</p>

<p>I have a main class that looks as follows:</p>

<pre><code>@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "classpath:com/cfhayes/test/LookupADefinition.feature")
public class DefinitionTestSuite {
  public static void main(String[] args) throws Exception {
    JUnitCore.main("com.cfhayes.test.DefinitionTestSuite");
  }
}
</code></pre>

<p>And my feature file uses tags so that I can specify a single scenario to run:</p>

<pre><code>Feature: Lookup a definition

  @TEST-0001
  Scenario: Looking up the definition of 'apple'
    Given the user is on the Wikionary home page
    When the user looks up the definition of the word 'apple'
    Then they should see the definition 'A common, round fruit produced by the tree Malus domestica, cultivated in temperate climates.'

  @TEST-0002
  Scenario: Looking up the definition of 'pear'
    Given the user is on the Wikionary home page
    When the user looks up the definition of the word 'pear'
    Then they should see the definition 'An edible fruit produced by the pear tree, similar to an apple but elongated towards the stem.'
</code></pre>

<p>I'm hoping there is a way I can use JVM args with the executable JAR that would somehow allow me to set the cucumber options. I tried doing something like this:</p>

<pre><code>java -jar my-test-jar.jar -Dcucumber.options="--tags @TEST-0001" 
</code></pre>

<p>...but that still runs ALL tests.</p>

<p>Any ideas would be greatly appreciated.</p>