Package com.trivago.cluecumber.engine
Class CluecumberEngine
- java.lang.Object
-
- com.trivago.cluecumber.engine.CluecumberEngine
-
public final class CluecumberEngine extends Object
The main plugin class.
-
-
Constructor Summary
Constructors Constructor Description CluecumberEngine(CluecumberLogger logger, PropertyManager propertyManager, FileSystemManager fileSystemManager, FileIO fileIO, JsonPojoConverter jsonPojoConverter, ElementIndexPreProcessor elementIndexPreProcessor, ReportGenerator reportGenerator)Constructor for dependency injection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuild(String sourceJsonReportDirectory, String generatedHtmlReportDirectory)Cluecumber Report start method.voidsetCustomCssFile(String customCss)Custom CSS file to override default styles.voidsetCustomNavigationLinks(LinkedHashMap<String,String> customNavigationLinks)Custom navigation links to display at the end of the default navigation.voidsetCustomPageTitle(String customPageTitle)Set a custom page tite for the report.voidsetCustomParameters(LinkedHashMap<String,String> customParameters)Custom parameters to display at the top of the test report.voidsetCustomParametersDisplayMode(String customParametersDisplayMode)Where to display custom parameters.voidsetCustomParametersFile(String customParametersFile)Set a file that contains custom parameters as properties.voidsetCustomStatusColorFailed(String customStatusColorFailed)Set a custom color for failed scenarios.voidsetCustomStatusColorPassed(String customStatusColorPassed)Set a custom color for passed scenarios.voidsetCustomStatusColorSkipped(String customStatusColorSkipped)Set a custom color for skipped scenarios.voidsetExpandAttachments(boolean expandAttachments)Whether to expand attachments or not.voidsetExpandBeforeAfterHooks(boolean expandBeforeAfterHooks)Whether to expand before and after hooks or not.voidsetExpandDocStrings(boolean expandDocStrings)Whether to expand doc strings or not.voidsetExpandStepHooks(boolean expandStepHooks)Whether to expand step hooks or not.voidsetFailScenariosOnPendingOrUndefinedSteps(boolean failScenariosOnPendingOrUndefinedSteps)Whether to fail scenarios when steps are pending or undefined.voidsetLogLevel(String logLevel)Set the log level for Cluecumber output.voidsetStartPage(String startPage)Set the start page of the test report that should be directed to.
-
-
-
Constructor Detail
-
CluecumberEngine
@Inject public CluecumberEngine(CluecumberLogger logger, PropertyManager propertyManager, FileSystemManager fileSystemManager, FileIO fileIO, JsonPojoConverter jsonPojoConverter, ElementIndexPreProcessor elementIndexPreProcessor, ReportGenerator reportGenerator)
Constructor for dependency injection.- Parameters:
elementIndexPreProcessor- TheElementIndexPreProcessorinstance.fileIO- TheFileIOinstance.fileSystemManager- TheFileSystemManagerinstance.jsonPojoConverter- TheJsonPojoConverterinstance.logger- TheCluecumberLoggerinstance.propertyManager- ThePropertyManagerinstance.reportGenerator- TheReportGeneratorinstance.
-
-
Method Detail
-
build
public void build(String sourceJsonReportDirectory, String generatedHtmlReportDirectory) throws CluecumberException
Cluecumber Report start method.- Parameters:
sourceJsonReportDirectory- The source directory of Cucumber JSON files.generatedHtmlReportDirectory- The target directory of the generated report.- Throws:
CluecumberException- When thrown, the plugin execution is stopped.
-
setCustomParameters
public void setCustomParameters(LinkedHashMap<String,String> customParameters)
Custom parameters to display at the top of the test report.- Parameters:
customParameters- A map of custom key value pairs.
-
setCustomParametersFile
public void setCustomParametersFile(String customParametersFile) throws CluecumberException
Set a file that contains custom parameters as properties.- Parameters:
customParametersFile- The path to a properties file.- Throws:
CluecumberException- Thrown on any error.
-
setCustomParametersDisplayMode
public void setCustomParametersDisplayMode(String customParametersDisplayMode)
Where to display custom parameters.- Parameters:
customParametersDisplayMode- The display mode for custom parameters.
-
setCustomNavigationLinks
public void setCustomNavigationLinks(LinkedHashMap<String,String> customNavigationLinks)
Custom navigation links to display at the end of the default navigation.- Parameters:
customNavigationLinks- A map of custom key value pairs (key is the link name, value is the URL).
-
setFailScenariosOnPendingOrUndefinedSteps
public void setFailScenariosOnPendingOrUndefinedSteps(boolean failScenariosOnPendingOrUndefinedSteps)
Whether to fail scenarios when steps are pending or undefined.- Parameters:
failScenariosOnPendingOrUndefinedSteps- On true, it will fail scenarios with pending or undefined steps.
-
setExpandBeforeAfterHooks
public void setExpandBeforeAfterHooks(boolean expandBeforeAfterHooks)
Whether to expand before and after hooks or not.- Parameters:
expandBeforeAfterHooks- If true, before and after hooks will be expanded.
-
setExpandStepHooks
public void setExpandStepHooks(boolean expandStepHooks)
Whether to expand step hooks or not.- Parameters:
expandStepHooks- If true, step hooks will be expanded.
-
setExpandDocStrings
public void setExpandDocStrings(boolean expandDocStrings)
Whether to expand doc strings or not.- Parameters:
expandDocStrings- If true, doc strings will be expanded.
-
setExpandAttachments
public void setExpandAttachments(boolean expandAttachments)
Whether to expand attachments or not.- Parameters:
expandAttachments- If true, attachments will be expanded.
-
setCustomCssFile
public void setCustomCssFile(String customCss) throws MissingFileException
Custom CSS file to override default styles.- Parameters:
customCss- The path to a CSS file.- Throws:
MissingFileException- Thrown if the specified file does not exist.
-
setCustomStatusColorPassed
public void setCustomStatusColorPassed(String customStatusColorPassed) throws WrongOrMissingPropertyException
Set a custom color for passed scenarios.- Parameters:
customStatusColorPassed- A color in hex format.- Throws:
WrongOrMissingPropertyException- Thrown if the property is missing or in a wrong format.
-
setCustomStatusColorFailed
public void setCustomStatusColorFailed(String customStatusColorFailed) throws WrongOrMissingPropertyException
Set a custom color for failed scenarios.- Parameters:
customStatusColorFailed- A color in hex format.- Throws:
WrongOrMissingPropertyException- Thrown if the property is missing or in a wrong format.
-
setCustomStatusColorSkipped
public void setCustomStatusColorSkipped(String customStatusColorSkipped) throws WrongOrMissingPropertyException
Set a custom color for skipped scenarios.- Parameters:
customStatusColorSkipped- A color in hex format.- Throws:
WrongOrMissingPropertyException- Thrown in case of a missing or incompatible property.
-
setCustomPageTitle
public void setCustomPageTitle(String customPageTitle)
Set a custom page tite for the report.- Parameters:
customPageTitle- The custom page title.
-
setStartPage
public void setStartPage(String startPage)
Set the start page of the test report that should be directed to.- Parameters:
startPage- The name of the start page (referring toSettings.StartPage).
-
setLogLevel
public void setLogLevel(String logLevel)
Set the log level for Cluecumber output.- Parameters:
logLevel- The log level (referring toCluecumberLogger.CluecumberLogLevel).
-
-