JBehave
  1. JBehave
  2. JBEHAVE-465

Methods annotated with AfterStories are not called if a step is causing a RuntimeException

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: web-3.3
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The AfterStory/BeforeStory annotations works in this case, so I would expect the same for the AfterStories annotation.

      Here is the setup code:

          StoryPathResolver storyPathResolver = new UnderscoredCamelCaseResolver(".story");
          Class storyClass = this.getClass();
          Properties viewProperties = new Properties();
          viewProperties.put("decorateNonHtml", "true");
          URL codeLocation = CodeLocations.codeLocationFromClass(storyClass);
          Configuration configuration = new MostUsefulConfiguration()
                  .useStoryControls(new StoryControls().doDryRun(false).doSkipScenariosAfterFailure(false))
                  .useStoryLoader(new LoadFromClasspath(storyClass.getClassLoader()))
                  .useStoryReporterBuilder(new StoryReporterBuilder()
                          .withCodeLocation(codeLocation)
                          .withDefaultFormats()
                          .withViewResources(viewProperties)
                          .withFormats(StoryReporterBuilder.Format.CONSOLE, StoryReporterBuilder.Format.TXT,
                                  StoryReporterBuilder.Format.HTML, StoryReporterBuilder.Format.XML)
                          .withFailureTrace(true))
                  .useStoryPathResolver(storyPathResolver)
                  .useStepMonitor(new SilentStepMonitor());
          useConfiguration(configuration);
          configuredEmbedder().embedderControls().doGenerateViewAfterStories(true);
      
          addSteps(new InstanceStepsFactory(configuration, this,
                  new CommonSteps(),
                  new UserProfileChecks(),
                  new CapConnectionWrapper(),
                  new SeleniumWrapper()).createCandidateSteps());
      

        Activity

        Hide
        Ivan Vanyushkin added a comment -

        Maybe related issue: JBEHAVE-390.

        Show
        Ivan Vanyushkin added a comment - Maybe related issue: JBEHAVE-390 .

          People

          • Assignee:
            Unassigned
            Reporter:
            Jan Tietjens
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: