public SeleniumContext seleniumContext() { synchronized (this) { if (seleniumContext == null) { seleniumContext = new SeleniumContext(); } } return seleniumContext; }
@Override public void beforeScenario(String title) { seleniumContext.setCurrentScenario(title); } }
public void performing(String step, boolean dryRun) { String currentScenario = context.getCurrentScenario(); contextView.show(currentScenario, step); super.performing(step, dryRun); }
public void performing(String step, boolean dryRun) { String currentScenario = context.getCurrentScenario(); contextView.show(currentScenario, step); super.performing(step, dryRun); }
public SeleniumContext seleniumContext() { synchronized (this) { if (seleniumContext == null) { seleniumContext = new SeleniumContext(); } } return seleniumContext; }
@Override public void beforeScenario(String title) { seleniumContext.setCurrentScenario(title); } }
@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); Configuration configuration = injectedEmbedder().configuration(); configuration.useFailureStrategy(new FailingUponPendingStep()) .useStoryControls(new StoryControls().doResetStateBeforeScenario(false)).useStepMonitor(stepMonitor) .useStoryLoader(new LoadFromClasspath(EtsyDotComStories.class)) .useStoryReporterBuilder(reporterBuilder); if (configuration instanceof SeleniumConfiguration) { SeleniumConfiguration seleniumConfiguration = (SeleniumConfiguration) configuration; seleniumConfiguration.useSeleniumContext(seleniumContext); } injectedEmbedder().runStoriesAsPaths(storyPaths()); }