Class PropertyManager


  • @Singleton
    public class PropertyManager
    extends Object
    This class stores and serves all Cluecumber properties.
    • Method Detail

      • getSourceJsonReportDirectory

        public String getSourceJsonReportDirectory()
        Get the root directory of the source JSON files.
        Returns:
        The path.
      • getGeneratedHtmlReportDirectory

        public String getGeneratedHtmlReportDirectory()
        Get the root directory of the target HTML report.
        Returns:
        The path.
      • getCustomParameters

        public Map<String,​String> getCustomParameters()
        Get the custom parameters to be shown at the top of the report.
        Returns:
        The map of custom parameter key value pairs.
      • setCustomParameters

        public void setCustomParameters​(Map<String,​String> customParameters)
        Set the custom parameters to be shown at the top of the report.
        Parameters:
        customParameters - The map of custom parameter key value pairs.
      • getCustomParametersFile

        public String getCustomParametersFile()
        Get the path to the custom parameter file.
        Returns:
        The path as string.
      • setCustomParametersFile

        public void setCustomParametersFile​(String customParametersFile)
                                     throws CluecumberException
        Set the path to the custom parameter file.
        Parameters:
        customParametersFile - The path as string.
        Throws:
        CluecumberException - Thrown on every error.
      • setCustomParametersDisplayMode

        public void setCustomParametersDisplayMode​(String customParametersDisplayMode)
        Set the display mode for custom parameters (on which page they should appear). Must be a value of Settings.CustomParamDisplayMode.
        Parameters:
        customParametersDisplayMode - The display mode string.
      • setCustomNavigationLinks

        public void setCustomNavigationLinks​(Map<String,​String> customNavigationLinks)
        Set the custom navigation links to appear next to the default Cluecumber navigation. The map key represents the caption to be display in the navigation, the value is the actual URL to link to.
        Parameters:
        customNavigationLinks - The map of key value pairs.
      • getNavigationLinks

        public List<Link> getNavigationLinks()
        Get the custom navigation links to appear next to the default Cluecumber navigation. The map key represents the caption to be display in the navigation, the value is the actual URL to link to.
        Returns:
        The map of key value pairs.
      • isFailScenariosOnPendingOrUndefinedSteps

        public boolean isFailScenariosOnPendingOrUndefinedSteps()
        This determines whether a scenario should be considered failed if it contains pending or undefined steps.
        Returns:
        true means fail on pending or undefined steps.
      • setFailScenariosOnPendingOrUndefinedSteps

        public void setFailScenariosOnPendingOrUndefinedSteps​(boolean failScenariosOnPendingOrUndefinedSteps)
        Set whether a scenario should be considered failed if it contains pending or undefined steps.
        Parameters:
        failScenariosOnPendingOrUndefinedSteps - true means fail on pending or undefined steps.
      • isExpandSubSections

        public boolean isExpandSubSections()
        This determines whether sub sections should be expanded by default.
        Returns:
        true means they should be expanded.
      • setExpandSubSections

        public void setExpandSubSections​(boolean expandSubSections)
        Set whether sub sections should be expanded by default.
        Parameters:
        expandSubSections - true means they should be expanded.
      • isExpandBeforeAfterHooks

        public boolean isExpandBeforeAfterHooks()
        This determines whether before and after hooks should be expanded by default.
        Returns:
        true means they should be expanded.
      • setExpandBeforeAfterHooks

        public void setExpandBeforeAfterHooks​(boolean expandBeforeAfterHooks)
        Set whether before and after hooks should be expanded by default.
        Parameters:
        expandBeforeAfterHooks - true means they should be expanded.
      • isExpandStepHooks

        public boolean isExpandStepHooks()
        This determines whether step hooks should be expanded by default.
        Returns:
        true means they should be expanded.
      • setExpandStepHooks

        public void setExpandStepHooks​(boolean expandStepHooks)
        Set whether step hooks should be expanded by default.
        Parameters:
        expandStepHooks - true means they should be expanded.
      • isExpandDocStrings

        public boolean isExpandDocStrings()
        This determines whether doc strings should be expanded by default.
        Returns:
        true means they should be expanded.
      • setExpandDocStrings

        public void setExpandDocStrings​(boolean expandDocStrings)
        Set whether doc strings should be expanded by default.
        Parameters:
        expandDocStrings - true means they should be expanded.
      • isExpandAttachments

        public boolean isExpandAttachments()
        This determines whether attachments should be expanded by default.
        Returns:
        true means they should be expanded.
      • isExpandOutputs

        public boolean isExpandOutputs()
        This determines whether step outputs should be expanded by default.
        Returns:
        true means they should be expanded.
      • setExpandAttachments

        public void setExpandAttachments​(boolean expandAttachments)
        Set whether attachments should be expanded by default.
        Parameters:
        expandAttachments - true means they should be expanded.
      • setExpandOutputs

        public void setExpandOutputs​(boolean expandOutputs)
        Set whether step outputs should be expanded by default.
        Parameters:
        expandOutputs - true means they should be expanded.
      • isGroupPreviousScenarioRuns

        public boolean isGroupPreviousScenarioRuns()
        This determines whether the scenarios run multiple times should be grouped and the show not last run toggle should be shown.
        Returns:
        true means scenarios should be grouped and toggle should be shown.
      • setGroupPreviousScenarioRuns

        public void setGroupPreviousScenarioRuns​(boolean groupPreviousScenarioRuns)
        Set whether the scenarios run multiple times should be grouped and the show not last run toggle should be shown.
        Parameters:
        groupPreviousScenarioRuns - true means scenarios should be grouped and toggle should be shown.
      • isExpandPreviousScenarioRuns

        public boolean isExpandPreviousScenarioRuns()
        This determines whether the not last run elements should be expanded and shown.
        Returns:
        true means it should be expanded.
      • setExpandPreviousScenarioRuns

        public void setExpandPreviousScenarioRuns​(boolean expandPreviousScenarioRuns)
        Set whether the not last run elements should be expanded and shown.
        Parameters:
        expandPreviousScenarioRuns - true means elements should be expanded.
      • getCustomCssFile

        public String getCustomCssFile()
        Get the custom CSS file path.
        Returns:
        The path.
      • setCustomCssFile

        public void setCustomCssFile​(String customCssFile)
                              throws MissingFileException
        Set the custom CSS file path.
        Parameters:
        customCssFile - The path.
        Throws:
        MissingFileException - Thrown if the file is not found.
      • getCustomStatusColorPassed

        public String getCustomStatusColorPassed()
        Get the custom hex color for passed elements.
        Returns:
        The hex color string.
      • getCustomStatusColorFailed

        public String getCustomStatusColorFailed()
        Get the custom hex color for failed elements.
        Returns:
        The hex color string.
      • getCustomStatusColorSkipped

        public String getCustomStatusColorSkipped()
        Get the custom hex color for skipped elements.
        Returns:
        The hex color string.
      • getCustomPageTitle

        public String getCustomPageTitle()
        Get the custom page title of the report.
        Returns:
        The page title.
      • setCustomPageTitle

        public void setCustomPageTitle​(String customPageTitle)
        Set the custom page title of the report.
        Parameters:
        customPageTitle - The page title.
      • logProperties

        public void logProperties()
        Log Cluecumber properties on the command line based on the set log level.
      • setStartPage

        public void setStartPage​(String startPage)
        Set the start page of the report.
        Parameters:
        startPage - The name of the start page (must be included in the Settings.StartPage enum.