JBehaveRunner { public static void executeFeatures() { try { transformData(); embedder().runStoriesAsPaths(getFeatures()); } catch (Throwable e) { Throwables.propagate((e.getCause() != null) ? e.getCause() : e); } finally { deleteTransformedFiles(); LOG.info("Execution of stories finished"); AllureStoryReporter.generateReport(); } }  static List<String> getFeatures(); static void transformData(); static void deleteTransformedFiles(); static BmoEmbedder embedder(); static void executeFeatures(); static Map<String, String> currentExample(); static final String[] DEFAULT_STORY_EXTENTIONS; static final List<String> transformedFiles; }
@Test public void should_executeFeaturesAndPass() { ConfigLoader.config().setProperty("bdd.story.files", "pass"); ConfigLoader.config().setProperty("bdd.steps.package", "com.automationrockstars"); JBehaveRunner.executeFeatures(); }
@Test public void should_executeFeaturesAndFail() { try { ConfigLoader.config().setProperty("bdd.story.files", "fail"); ConfigLoader.config().setProperty("bdd.steps.package", "com.automationrockstars"); JBehaveRunner.executeFeatures(); throw new AssertionError("It didnt fail"); } catch (org.jbehave.core.embedder.Embedder.RunningStoriesFailed e) { } }
@Test public void should_executeFeatureAndReport() { ConfigLoader.config().setProperty("bdd.story.files", "story"); ConfigLoader.config().setProperty("bdd.steps.package", "com.automationrockstars"); JBehaveRunner.executeFeatures(); }
@Test public void should_verifyCornerCases() { ConfigLoader.config().setProperty("bdd.story.files", "feature"); ConfigLoader.config().setProperty("bdd.steps.package", "com.automationrockstars"); JBehaveRunner.executeFeatures(); }