Class SystemPropertiesConfiguration
java.lang.Object
net.thucydides.model.configuration.SystemPropertiesConfiguration
- All Implemented Interfaces:
Configuration
Centralized configuration of the test runner. You can configure the output
directory, the browser to use, and the reports to generate. Most
configuration elements can be set using system properties.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected EnvironmentVariablesprotected FileHTML reports will be generated in this directory.static final StringIf in system properties will be defined project.build.directory or project.reporting.OutputDirectory then it will be used for output for serenity test reports.protected FileJSON reports will be read from here -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis is the URL where test cases start.intThis is the URL where test cases start.intdoubleThe output directory is where the test runner writes the XML and HTML reports to.intHow often should screenshots be taken.intbooleanDeprecated.Where should the reports go?booleanvoidIf some property that can change output directory@Override was changed this method should be calledvoidsetDefaultBaseUrl(String defaultBaseUrl) Override the default base URL manually.voidsetIfUndefined(String property, String value) voidsetOutputDirectory(File outputDirectory) voidsetProjectDirectory(Path projectDirectory) voidsetSourceDirectory(File sourceDirectory) booleanDeprecated.booleanTake a screenshot for each action.withEnvironmentVariables(EnvironmentVariables environmentVariables)
-
Field Details
-
PROJECT_BUILD_DIRECTORY
If in system properties will be defined project.build.directory or project.reporting.OutputDirectory then it will be used for output for serenity test reports. By default maven NEVER push this properties to system environment, but they are available in maven. This property is used when maven/gradle build contains sub-projects- See Also:
-
outputDirectory
HTML reports will be generated in this directory. -
sourceDirectory
JSON reports will be read from here -
defaultBaseUrl
-
environmentVariables
-
-
Constructor Details
-
SystemPropertiesConfiguration
-
-
Method Details
-
withEnvironmentVariables
public SystemPropertiesConfiguration withEnvironmentVariables(EnvironmentVariables environmentVariables) - Specified by:
withEnvironmentVariablesin interfaceConfiguration
-
getEnvironmentVariables
- Specified by:
getEnvironmentVariablesin interfaceConfiguration
-
loadOutputDirectoryFromSystemProperties
Where should the reports go? -
loadHistoryDirectoryFromSystemProperties
-
reloadOutputDirectory
public void reloadOutputDirectory()If some property that can change output directory@Override was changed this method should be called -
getStepDelay
public int getStepDelay()- Specified by:
getStepDelayin interfaceConfiguration
-
getElementTimeoutInSeconds
public int getElementTimeoutInSeconds()- Specified by:
getElementTimeoutInSecondsin interfaceConfiguration
-
getUseUniqueBrowser
Deprecated.Description copied from interface:ConfigurationUse shouldUseAUniqueBrowser() instead- Specified by:
getUseUniqueBrowserin interfaceConfiguration
-
shouldUseAUniqueBrowser
Deprecated.- Specified by:
shouldUseAUniqueBrowserin interfaceConfiguration
-
setOutputDirectory
- Specified by:
setOutputDirectoryin interfaceConfiguration
-
setSourceDirectory
- Specified by:
setSourceDirectoryin interfaceConfiguration
-
setProjectDirectory
- Specified by:
setProjectDirectoryin interfaceConfiguration
-
getProjectDirectory
- Specified by:
getProjectDirectoryin interfaceConfiguration
-
getOutputDirectory
The output directory is where the test runner writes the XML and HTML reports to. By default, it will be in 'target/site/serenity', but you can override this value either programmatically or by providing a value in the thucydides.output.dir system property. - serenity.outputDirectory is used to override the default output directory for the Serenity reports - project.reporting.OutputDirectory is used by Maven to define the output directory for the whole project (e.g. target/site) - project.build.directory is used by Maven to define the build directory for the whole project (e.g. target)- Specified by:
getOutputDirectoryin interfaceConfiguration
-
getSourceDirectory
-
getHistoryDirectory
- Specified by:
getHistoryDirectoryin interfaceConfiguration
-
getEstimatedAverageStepCount
public double getEstimatedAverageStepCount()- Specified by:
getEstimatedAverageStepCountin interfaceConfiguration
-
onlySaveFailingScreenshots
public boolean onlySaveFailingScreenshots()- Specified by:
onlySaveFailingScreenshotsin interfaceConfiguration
-
takeVerboseScreenshots
public boolean takeVerboseScreenshots()Description copied from interface:ConfigurationTake a screenshot for each action.- Specified by:
takeVerboseScreenshotsin interfaceConfiguration
-
getScreenshotLevel
Description copied from interface:ConfigurationHow often should screenshots be taken.- Specified by:
getScreenshotLevelin interfaceConfiguration
-
setIfUndefined
- Specified by:
setIfUndefinedin interfaceConfiguration
-
setDefaultBaseUrl
Override the default base URL manually. Normally only needed for testing.- Specified by:
setDefaultBaseUrlin interfaceConfiguration
-
getRestartFrequency
public int getRestartFrequency()- Specified by:
getRestartFrequencyin interfaceConfiguration
-
getCurrentTestCount
public int getCurrentTestCount()Description copied from interface:ConfigurationThis is the URL where test cases start. The default value can be overriden using the webdriver.baseurl property. It is also the base URL used to build relative paths.- Specified by:
getCurrentTestCountin interfaceConfiguration
-
getBaseUrl
This is the URL where test cases start. The default value can be overriden using the webdriver.baseurl property. It is also the base URL used to build relative paths.- Specified by:
getBaseUrlin interfaceConfiguration
-