/** * Retrieves the location of the stories. <br> * This method is intended to be overwritten on divergent location for stories * than src/test/resources * * @return location of the stories to look for. */ protected URL getStoryLocation() { return codeLocationFromPath("src/test/resources"); }
public GroovyResourceFinder(){ this(CodeLocations.codeLocationFromPath("src/main/groovy"), "**/*.groovy", ""); }
protected URL getStoryLocation() { return codeLocationFromPath(JBehaveConstants.DEFAULT_STORY_LOCATION); }
protected Map<String, Resource> createIndexFromPaths(String rootURI, String rootPath, String syntax, String includes) { Map<String, Resource> index = new HashMap<>(); List<String> paths = new StoryFinder().findPaths( codeLocationFromPath(rootPath), includes, EMPTY); for (String path : paths) { addPath(rootURI, rootPath, fullPath(rootPath, path), syntax, index); } return index; }
/** * Creates a new {@link StoryReporterBuilder} using {@link com.epam.gepard.gherkin.jbehave.JBehaveStoryReporter}. * @param testCase the test case to use for reporting * @return the new instance */ public StoryReporterBuilder createForTestCase(final JBehaveTestCase testCase) { URL codeLocation = CodeLocations.codeLocationFromPath(""); return new StoryReporterBuilder().withCodeLocation(codeLocation).withRelativeDirectory("").withReporters(new JBehaveStoryReporter(testCase)); } }
private void reportToDirectory(String path) { embedder.configuration().storyReporterBuilder().withCodeLocation(codeLocationFromPath(path)) .withDefaultFormats().withFormats(HTML, TXT, XML).withCrossReference(new CrossReference()); }
private void reportToDirectory(String path) { embedder.configuration().storyReporterBuilder().withCodeLocation(codeLocationFromPath(path)) .withDefaultFormats().withFormats(HTML, TXT, XML).withCrossReference(new CrossReference()); }
@Override public Configuration configuration() { Class<? extends JSystemEmbedder> embedderClass = this.getClass(); StoryParser parser = null; switch (parserType) { case GHERKIN: parser = new GherkinStoryParser(); break; case REGEX: parser = new RegexStoryParser(); break; default: parser = new RegexStoryParser(); } return new MostUsefulConfiguration() .useStoryParser(parser) .useStoryLoader(new LoadFromClasspath(embedderClass.getClassLoader())) .useStoryReporterBuilder( new StoryReporterBuilder() .withCodeLocation(CodeLocations.codeLocationFromClass(embedderClass)) .withDefaultFormats() .withCodeLocation(CodeLocations.codeLocationFromPath(getReportsFolder())) .withFormats(org.jbehave.core.reporters.Format.CONSOLE, Format.HTML, Format.XML, Format.TXT).withCrossReference(new CrossReference())) .useStepPatternParser(new RegexPrefixCapturingPatternParser("%")) .useStepMonitor(new SilentStepMonitor()); }