Package org.jbehave.core.reporters

Examples of org.jbehave.core.reporters.CrossReference$StoryHolder


      .useStoryLoader(new LoadFromClasspath(embedderClass.getClassLoader()))
      .useStoryReporterBuilder(new StoryReporterBuilder()
            .withCodeLocation(CodeLocations.codeLocationFromClass(embedderClass))
            .withDefaultFormats()
        .withFormats(CONSOLE, TXT, HTML, XML)
        .withCrossReference(new CrossReference()))
            .useParameterConverters(new ParameterConverters()
                  .addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))) // use custom date pattern
            .useStepPatternParser(new RegexPrefixCapturingPatternParser(
              "%")) // use '%' instead of '$' to identify parameters
      .useStepMonitor(new SilentStepMonitor());               
View Full Code Here


    @Test
    public void shouldGenerateCrossReferenceWhenAvailable() {

        Embedder embedder = new Embedder();
        embedder.useConfiguration(new MostUsefulConfiguration().useStoryReporterBuilder(new StoryReporterBuilder()
                .withCrossReference(new CrossReference())));

        // When
        embedder.generateCrossReference();

        // Then
View Full Code Here

public class EtsyDotComStories extends JUnitStories {

    public EtsyDotComStories() {

        PendingStepStrategy pendingStepStrategy = new FailingUponPendingStep();
        CrossReference crossReference = new SauceContextOutput.SauceLabsCrossReference(new HashMap<String, String>())
                .withJsonOnly().withOutputAfterEachStory(true).withPendingStepStrategy(pendingStepStrategy)
                .excludingStoriesWithNoExecutedScenarios(true);

        SeleniumContext seleniumContext = new SeleniumContext();
        WebDriverProvider driverProvider;
        Format[] formats;
        ContextView contextView;

        if (System.getProperty("SAUCE_USERNAME") != null) {
            driverProvider = new SauceWebDriverProvider();
            formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML };
            contextView = new SauceLabsContextView(driverProvider);
            crossReference.withThreadSafeDelegateFormat(new SauceContextOutput(driverProvider, seleniumContext,
                    new HashMap<String, String>()));
        } else if (System.getProperty("REMOTE") != null) {
            driverProvider = new RemoteWebDriverProvider();
            formats = new Format[] { CONSOLE, WEB_DRIVER_HTML };
            contextView = new ContextView.NULL();
        } else {
            driverProvider = new FirefoxWebDriverProvider();
            formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML };
            contextView = new LocalFrameContextView().sized(640, 120);
        }

        StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
                .withCodeLocation(CodeLocations.codeLocationFromClass(EtsyDotComStories.class)).withFailureTrace(true)
                .withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
                .withCrossReference(crossReference);

        Configuration configuration = new SeleniumConfiguration().useWebDriverProvider(driverProvider)
                .useSeleniumContext(seleniumContext).useFailureStrategy(new RethrowingFailure())
                .usePendingStepStrategy(pendingStepStrategy)
                .useStoryControls(new StoryControls().doResetStateBeforeScenario(false))
                .useStepMonitor(new SeleniumStepMonitor(contextView, seleniumContext, crossReference.getStepMonitor()))
                .useStoryLoader(new LoadFromClasspath(EtsyDotComStories.class))
                .useStoryReporterBuilder(reporterBuilder);
        useConfiguration(configuration);

        final ThreadCaching primordialCaching = new ThreadCaching();
View Full Code Here

    public AnnotatedEtsyDotComStories() {
    }

    @Test
    public void run() throws Throwable {
        CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
                .excludingStoriesWithNoExecutedScenarios(true);
        ContextView contextView = new LocalFrameContextView().sized(640, 120);
        SeleniumContext seleniumContext = new SeleniumContext();
        SeleniumStepMonitor stepMonitor = new SeleniumStepMonitor(contextView, seleniumContext,
                crossReference.getStepMonitor());
        Format[] formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML };
        StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
                .withCodeLocation(codeLocationFromClass(EtsyDotComStories.class)).withFailureTrace(true)
                .withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
                .withCrossReference(crossReference);
View Full Code Here

/**
* Stories class that should be extended for every story
*/
public abstract class PortalStories extends JUnitStories {
  protected PortalStories() {
    CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
        .excludingStoriesWithNoExecutedScenarios(true);
    ContextView contextView = new LocalFrameContextView().sized(640, 120);
    SeleniumContext seleniumContext = new SeleniumContext();
    SeleniumStepMonitor stepMonitor = new SeleniumStepMonitor(contextView, seleniumContext,
        crossReference.getStepMonitor());
    Format[] formats = new Format[]{new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML};
    StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
        .withCodeLocation(codeLocationFromClass(this.getClass())).withFailureTrace(true)
        .withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
        .withCrossReference(crossReference);
View Full Code Here

TOP

Related Classes of org.jbehave.core.reporters.CrossReference$StoryHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.