Interface ReportBlockConverter


  • public interface ReportBlockConverter
    Converts elements of the report model into standalone text blocks.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String convertCaseFooterBlock​(java.lang.String errorMessage, java.util.List<java.lang.String> stackTraceLines)
      Is invoked if the case failed with an exception.
      java.lang.String convertCaseHeaderBlock​(int caseNr, ExecutionStatus executionStatus, long duration, java.lang.String description)
      Convert scenario case number and parameters into case header.
      java.lang.String convertCasesTableBlock​(CasesTable casesTable)
      Is invoked at the end of a scenario, when the scenario has multiple case and a data table.
      java.lang.String convertFeatureHeaderBlock​(java.lang.String featureName, ReportStatistics statistics, java.lang.String description)
      Convert feature name and execution statistics into feature header.
      java.lang.String convertFirstStepBlock​(int depth, java.util.List<Word> words, StepStatus status, long durationInNanos, java.lang.String extendedDescription, boolean caseIsUnsuccessful, java.lang.String currentSectionTitle)
      Convert the words that make up the first step into a block.
      java.lang.String convertScenarioFooterBlock​(ExecutionStatus executionStatus)
      Is invoked at the end of a scenario.
      java.lang.String convertScenarioHeaderBlock​(java.lang.String name, ExecutionStatus executionStatus, long duration, java.util.List<Tag> tagNames, java.lang.String extendedDescription)
      Convert scenario name and more meta information into scenario header.
      java.lang.String convertStatisticsBlock​(com.google.common.collect.ListMultimap<java.lang.String,​ReportStatistics> featureStatistics, ReportStatistics totalStatistics)
      Convert a set of execution statistics into a statistics table.
      java.lang.String convertStepBlock​(int depth, java.util.List<Word> words, StepStatus status, long durationInNanos, java.lang.String extendedDescription, boolean caseIsUnsuccessful)
      Convert the words that make up a step into a block.
    • Method Detail

      • convertStatisticsBlock

        java.lang.String convertStatisticsBlock​(com.google.common.collect.ListMultimap<java.lang.String,​ReportStatistics> featureStatistics,
                                                ReportStatistics totalStatistics)
        Convert a set of execution statistics into a statistics table.
        Parameters:
        featureStatistics - a map from feature names to statistics
        totalStatistics - the total statistics for all features combined
      • convertFeatureHeaderBlock

        java.lang.String convertFeatureHeaderBlock​(java.lang.String featureName,
                                                   ReportStatistics statistics,
                                                   java.lang.String description)
        Convert feature name and execution statistics into feature header.
        Parameters:
        featureName - the feature's name
        statistics - the execution statistics for the feature
        description - the description, may be null
      • convertScenarioHeaderBlock

        java.lang.String convertScenarioHeaderBlock​(java.lang.String name,
                                                    ExecutionStatus executionStatus,
                                                    long duration,
                                                    java.util.List<Tag> tagNames,
                                                    java.lang.String extendedDescription)
        Convert scenario name and more meta information into scenario header.

        The name corresponds to the test method name

        Parameters:
        name - the name of the scenario
        executionStatus - was the scenario successful
        duration - how long did the scenario run
        tagNames - names of the tags if scenario is tagged
        extendedDescription - detailed description of the scenario, may be null
      • convertCaseHeaderBlock

        java.lang.String convertCaseHeaderBlock​(int caseNr,
                                                ExecutionStatus executionStatus,
                                                long duration,
                                                java.lang.String description)
        Convert scenario case number and parameters into case header.

        It is guaranteed that parameterNames.size() == caseArgument.size()

        Parameters:
        caseNr - the number of the case, starting from 1
        executionStatus - whether the case was successful
        duration - how long did the scenario case run
        description - a short description of this case, may be null
      • convertFirstStepBlock

        java.lang.String convertFirstStepBlock​(int depth,
                                               java.util.List<Word> words,
                                               StepStatus status,
                                               long durationInNanos,
                                               java.lang.String extendedDescription,
                                               boolean caseIsUnsuccessful,
                                               java.lang.String currentSectionTitle)
        Convert the words that make up the first step into a block.
        Parameters:
        depth - the depth of the step
        words - the words to be converted
        status - was the step executed successfully
        durationInNanos - how long did the step take
        extendedDescription - detailed description of the step, may be null
        caseIsUnsuccessful - was the scenario case executed successfully
        currentSectionTitle - the current section's title, may be null
      • convertStepBlock

        java.lang.String convertStepBlock​(int depth,
                                          java.util.List<Word> words,
                                          StepStatus status,
                                          long durationInNanos,
                                          java.lang.String extendedDescription,
                                          boolean caseIsUnsuccessful)
        Convert the words that make up a step into a block.
        Parameters:
        depth - the depth of the step
        words - the words to be converted
        status - was the step executed successfully
        durationInNanos - how long did the step take
        extendedDescription - detailed description of the step, may be null
        caseIsUnsuccessful - was the scenario case executed successfully
      • convertCasesTableBlock

        java.lang.String convertCasesTableBlock​(CasesTable casesTable)
        Is invoked at the end of a scenario, when the scenario has multiple case and a data table.
        Parameters:
        casesTable - the data table of the scenario
      • convertCaseFooterBlock

        java.lang.String convertCaseFooterBlock​(java.lang.String errorMessage,
                                                java.util.List<java.lang.String> stackTraceLines)
        Is invoked if the case failed with an exception.
        Parameters:
        errorMessage - the message describing the error
        stackTraceLines - the stacktrace lines if present
      • convertScenarioFooterBlock

        java.lang.String convertScenarioFooterBlock​(ExecutionStatus executionStatus)
        Is invoked at the end of a scenario.
        Parameters:
        executionStatus - was the scenario successful