JBehave
  1. JBehave
  2. JBEHAVE-1036

StoryReporterBuilder fails to parse test results if story has GivenStories

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      3

      Description

      In case of story with GivenStories JBehave raport is broken. Although few scenarios has been successfully performed - "Scenarios" and "Steps" are missing. Duration is improperly set to zero.

      Example of problematic story:
      @author         Przemyslaw Kwiecien
      @organization   Example Organization Systems Ltd.
      
      GivenStories: com/sample/qa/stories/functionality1.story#{id06:create_something_with_rates},
                    com/sample/qa/stories/other.story#{id09:full_sample}
      
      Scenario: Create Something
      .
      .
      .
      

      Report generated with such story is attached as "jbehaveBrokenReport.jpg".
      If GivenStories is replaced by corresponding steps report is fine ("jbehaveBrokenReport-withoutGivenStories.jpg").
      "jbehaveBrokenReport2.jpg" file shows more errors caused by the same problem. This time more stories were run - duration is totally broken.

      I am using following JBehave versions:
      <jbehave.core.version>4.0-beta-9</jbehave.core.version>
      <jbehave.site.version>3.2</jbehave.site.version>

      Configuration
          @Override
          public Configuration configuration() {
              Class<? extends SanityEmbedder> embedderClass = this.getClass();
              ParameterConverters parameterConverters = new ParameterConverters();
              ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), new LoadFromClasspath(embedderClass), parameterConverters);
              parameterConverters.addConverters(new ParameterConverters.DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
                      new ParameterConverters.ExamplesTableConverter(examplesTableFactory), new ParameterConverters.BooleanConverter("true", "false"));
      
              return new MostUsefulConfiguration()
                      .useStoryLoader(new LoadFromClasspath(embedderClass.getClassLoader()))
                      .useStoryParser(new RegexStoryParser(examplesTableFactory))
                      .useStoryReporterBuilder(new StoryReporterBuilder()
                              .withCodeLocation(CodeLocations.codeLocationFromClass(embedderClass))
                              .withDefaultFormats()
                              .withFormats(CONSOLE, TXT, HTML, XML)
                              .withCrossReference(new CrossReference())
                              .withFailureTrace(true)
                              .withFailureTraceCompression(false))
                      .useParameterConverters(parameterConverters) // use custom date pattern
                      .useStepPatternParser(new RegexPrefixCapturingPatternParser(
                              "$")) // use '%' instead of '$' to identify parameters - this little devil is optional
                      .useStepMonitor(new SilentStepMonitor())
                      .useParameterConverters(parameterConverters);
          }
      

        Activity

        Hide
        Mauro Talevi added a comment -

        Rather than providing a set of morsels of code and configuration, it'd be much easier if you could provide a simple Maven sample project that reproduced this behaviour.

        Show
        Mauro Talevi added a comment - Rather than providing a set of morsels of code and configuration, it'd be much easier if you could provide a simple Maven sample project that reproduced this behaviour.
        Hide
        Przemyslaw Kwiecien added a comment -

        Hi Mauro - thank you for your fast reply.
        Please use WithoutGivenStoriesStories and GivenStoriesStories from https://github.com/przemekkwiecien1982/jbehave-issues.git to see issue.

        Show
        Przemyslaw Kwiecien added a comment - Hi Mauro - thank you for your fast reply. Please use WithoutGivenStoriesStories and GivenStoriesStories from https://github.com/przemekkwiecien1982/jbehave-issues.git to see issue.
        Hide
        Jeremie Huchet added a comment -

        I submitted a pull request on Github to fix this.

        Show
        Jeremie Huchet added a comment - I submitted a pull request on Github to fix this.
        Hide
        Mauro Talevi added a comment -

        Pulled with thanks

        Show
        Mauro Talevi added a comment - Pulled with thanks
        Mauro Talevi made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Fix Version/s 4.0 [ 18486 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Przemyslaw Kwiecien
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: