JBehave
  1. JBehave
  2. JBEHAVE-1040

images/failing_screenshot.png missing?

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      (Duplicating issue that I filed here: https://github.com/jbehave/jbehave-web/issues/15)

      In commit f6a545fcd280da73d854ce91e3d2f8693f510e32 a reference to images/failing_screenshot.png was added, however I don't see a corresponding commit in https://github.com/jbehave/jbehave-site/tree/master/site-resources/src/main/resources/images?

      Futhermore I don't quite understand why the screenshot itself isn't inlined by default. There is a link to the correct screenshot, but the 'thumbnail image' isn't found. How about:

      <img src=\"../screenshots/failed-scenario-{3}.png\" alt=\"failing screenshot\"/>
      

      instead of

      <a color=\"black\" href=\"../screenshots/failed-scenario-{3}.png\"><img src=\"images/failing_screenshot.png\" alt=\"failing screenshot\"/></a>
      

      We are only talking about the 'failed' case here so it's not like the complete report is littered with screenshots (assuming of course your tests succeed most of the time :wink

      Lastly, as a workaround you can use this format instead if you want to have inline images:

      public class MyWebDriverHtmlOutput extends HtmlOutput {
      
         public static final org.jbehave.core.reporters.Format MY_WEB_DRIVER_HTML = new MyWebDriverHtmlFormat();
      
         public MyWebDriverHtmlOutput(PrintStream output, Keywords keywords) {
            super(output, failedPatternProperties(), keywords);
         }
      
         private static Properties failedPatternProperties() {
            Properties properties = new Properties();
            properties.put("failed",
                  "<div class=\"step failed\">{0} <span class=\"keyword failed\">({1})</span><br/>" +
                        "<span class=\"message failed\">{2}</span><br/>" +
                        "<img src=\"../screenshots/failed-scenario-{3}.png\" alt=\"failing screenshot\"/></div>\n");
            return properties;
         }
      
         private static class MyWebDriverHtmlFormat extends org.jbehave.core.reporters.Format {
      
            public MyWebDriverHtmlFormat() {
               super("HTML");
            }
      
            @Override
            public StoryReporter createStoryReporter(FilePrintStreamFactory factory, StoryReporterBuilder storyReporterBuilder) {
               factory.useConfiguration(storyReporterBuilder.fileConfiguration("html"));
               return new MyWebDriverHtmlOutput(factory.createPrintStream(), storyReporterBuilder.keywords())
                     .doReportFailureTrace(storyReporterBuilder.reportFailureTrace())
                     .doCompressFailureTrace(storyReporterBuilder.compressFailureTrace());
            }
         }
      }
      

        Activity

        There are no entries against this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Auke van Leeuwen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: