Class Configuration


  • public class Configuration
    extends Object
    • Constructor Detail

      • Configuration

        public Configuration​(File reportDirectory,
                             String projectName)
    • Method Detail

      • getReportDirectory

        public File getReportDirectory()
        Returns directory where the report should be stored.
        Returns:
        directory for the report
      • getTrendsStatsFile

        public File getTrendsStatsFile()
        Returns file with history with trends.
        Returns:
        file with trends
      • isTrendsStatsFile

        public boolean isTrendsStatsFile()
        Checks if the file for the trends was set.
        Returns:
        true if the file location was provided, otherwise false
      • setTrendsStatsFile

        public void setTrendsStatsFile​(File trendsFile)
        Calls setTrends(File, int) with zero limit.
        Parameters:
        trendsFile - file with trends
      • getTrendsLimit

        public int getTrendsLimit()
        Returns number of historical reports presented by trends.
        Returns:
        number of reports in trends
      • isTrendsAvailable

        public boolean isTrendsAvailable()
        Checks if the trends page should be generated and displayed.
        Returns:
        true if the page with trends should be displayed
      • setTrends

        public void setTrends​(File trendsFile,
                              int limit)
        Sets configuration limit for trends. When the limit is set to 0 then all items will be stored and displayed. To disable saving and displaying trends page set to -1. Otherwise number of previous builds is equal to provided limit.
        Parameters:
        trendsFile - file where information about previous builds is stored
        limit - number of builds that should be presented (older builds are skipped)
      • getBuildNumber

        public String getBuildNumber()
        Gets the build number for this report.
        Returns:
        build number
      • setBuildNumber

        public void setBuildNumber​(String buildNumber)
        Sets number of the build.
        Parameters:
        buildNumber - number of the build
      • getProjectName

        public String getProjectName()
        Returns the project name.
        Returns:
        name of the project
      • setDirectorySuffix

        public void setDirectorySuffix​(String directorySuffix)
        Sets directory suffix.
        Parameters:
        directorySuffix - directory suffix
      • getDirectorySuffix

        public String getDirectorySuffix()
        Returns directory suffix
        Returns:
        directory suffix
      • getDirectorySuffixWithSeparator

        public String getDirectorySuffixWithSeparator()
        Returns directory suffix with separator prepended if necessary
        Returns:
        directory suffix with prepended separator
      • getEmbeddingDirectory

        public File getEmbeddingDirectory()
        Gets directory where the attachments are stored.
        Returns:
        directory for attachment
      • getTagsToExcludeFromChart

        public Collection<Pattern> getTagsToExcludeFromChart()
        Returns:
        Patterns to be used to filter out tags in the 'Tags Overview' chart. Returns an empty list by default.
      • setTagsToExcludeFromChart

        public void setTagsToExcludeFromChart​(String... patterns)
        Stores the regex patterns to be used for filtering out tags from the 'Tags Overview' chart
        Parameters:
        patterns - Regex patterns to match against tags
        Throws:
        ValidationException - when any of the given strings is not a valid regex pattern.
      • addClassifications

        public void addClassifications​(String name,
                                       String value)
        Adds metadata that will be displayed at the main page of the report. It is useful when there is a few reports are generated at the same time but with different parameters/configurations.
        Parameters:
        name - name of the property
        value - value of the property
      • getClassifications

        public List<Map.Entry<String,​String>> getClassifications()
        Returns the classification for the report.
      • setSortingMethod

        public void setSortingMethod​(SortingMethod sortingMethod)
        Configure how items will be sorted in the report by default.
        Parameters:
        sortingMethod - how the items should be sorted
      • getSortingMethod

        public SortingMethod getSortingMethod()
        Returns the default sorting method.
      • addReducingMethod

        public void addReducingMethod​(ReducingMethod reducingMethod)
        Sets how the report should be reduced, merged or modified.
        Parameters:
        reducingMethod - type of reduction
      • getReducingMethods

        public List<ReducingMethod> getReducingMethods()
        Gets how the report should be reduced, merged or modified.
        Returns:
        type of reduction
      • containsReducingMethod

        public boolean containsReducingMethod​(ReducingMethod reducingMethod)
        Checks if the configuration has given ReducingMethod set.
        Parameters:
        reducingMethod - method to validate
        Returns:
        true if method was set, otherwise false
      • addPresentationModes

        public void addPresentationModes​(PresentationMode presentationMode)
        Sets how the report should be presented.
        Parameters:
        presentationMode - method used for presentation
      • containsPresentationMode

        public boolean containsPresentationMode​(PresentationMode presentationMode)
        Checks if the configuration has given PresentationMode set.
        Parameters:
        presentationMode - method used for presentation
        Returns:
        true if mode was set, otherwise false
      • addClassificationFiles

        public void addClassificationFiles​(List<String> classificationFiles)
        Adds properties files which house classifications in key value pairings. When these properties files get processed these classifications get displayed on the main page of the report as metadata in the order in which they appear within the file.
      • getClassificationFiles

        public List<String> getClassificationFiles()
        Returns the list of properties files.
      • getNotFailingStatuses

        public Set<Status> getNotFailingStatuses()
        Gets statuses which do not fail scenario.
      • setNotFailingStatuses

        public void setNotFailingStatuses​(Set<Status> notFailingStatuses)
        Sets statuses of steps which should not fail the scenario.
      • setQualifier

        public void setQualifier​(@NonNull String jsonFileName,
                                 @NonNull String qualifier)
        Sets explicit qualifier to use for the given json file.
        Parameters:
        jsonFileName - JSON file name - without the extension
        qualifier - Qualifier to use
      • getQualifier

        public String getQualifier​(@NonNull String jsonFileName)
        Retrieves explicit qualifier to use for a given json file.
        Parameters:
        jsonFileName - JSON file name - without the extension
        Returns:
        Qualifier specified for this file or null if none specified
      • containsQualifier

        public boolean containsQualifier​(@NonNull String jsonFileName)
        Checks whether an explicit qualifier was specified for a given json file.
        Parameters:
        jsonFileName - JSON file name - without the extension
        Returns:
        true if the qualifier was specified, false otherwise
      • removeQualifier

        public void removeQualifier​(@NonNull String jsonFileName)
        Removes explicit qualifier for a given json file.
        Parameters:
        jsonFileName - JSON file name - without the extension
      • addCustomCssFiles

        public void addCustomCssFiles​(List<String> customCssFiles)
        Adds custom static css files to each html page.
      • getCustomCssFiles

        public List<String> getCustomCssFiles()
        Returns the list of custom css files.
      • addCustomJsFiles

        public void addCustomJsFiles​(List<String> customJsFiles)
        Adds custom static js files to each html page.
      • getCustomJsFiles

        public List<String> getCustomJsFiles()
        Returns the list of custom js files.