Class SystemPropertiesConfiguration
java.lang.Object
net.thucydides.core.configuration.SystemPropertiesConfiguration
- All Implemented Interfaces:
Configuration
public class SystemPropertiesConfiguration extends java.lang.Object implements 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
Fields Modifier and Type Field Description static int
DEFAULT_ELEMENT_TIMEOUT_SECONDS
Default timeout when waiting for AJAX elements in pages, in seconds.static java.lang.Integer
DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT
protected java.lang.String
defaultBaseUrl
protected EnvironmentVariables
environmentVariables
protected java.io.File
outputDirectory
HTML and XML reports will be generated in this directory.static java.lang.String
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.static java.lang.String
REFUSE_UNTRUSTED_CERTIFICATES
By default, when accepting untrusted SSL certificates, assume that these certificates will come from an untrusted issuer or will be self signed. -
Constructor Summary
Constructors Constructor Description SystemPropertiesConfiguration(EnvironmentVariables environmentVariables)
-
Method Summary
Modifier and Type Method Description java.lang.String
getBaseUrl()
This is the URL where test cases start.int
getCurrentTestCount()
This is the URL where test cases start.int
getElementTimeoutInSeconds()
EnvironmentVariables
getEnvironmentVariables()
double
getEstimatedAverageStepCount()
java.io.File
getHistoryDirectory()
java.io.File
getOutputDirectory()
The output directory is where the test runner writes the XML and HTML reports to.int
getRestartFrequency()
java.util.Optional<TakeScreenshots>
getScreenshotLevel()
How often should screenshots be taken.int
getStepDelay()
boolean
getUseUniqueBrowser()
Deprecated.java.io.File
loadHistoryDirectoryFromSystemProperties()
java.io.File
loadOutputDirectoryFromSystemProperties()
Where should the reports go?boolean
onlySaveFailingScreenshots()
void
reloadOutputDirectory()
If some property that can change output directory@Override was changed this method should be calledvoid
setDefaultBaseUrl(java.lang.String defaultBaseUrl)
Override the default base URL manually.void
setIfUndefined(java.lang.String property, java.lang.String value)
void
setOutputDirectory(java.io.File outputDirectory)
boolean
shouldUseAUniqueBrowser()
Deprecated.boolean
takeVerboseScreenshots()
Take a screenshot for each action.SystemPropertiesConfiguration
withEnvironmentVariables(EnvironmentVariables environmentVariables)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
DEFAULT_ELEMENT_TIMEOUT_SECONDS
public static final int DEFAULT_ELEMENT_TIMEOUT_SECONDSDefault timeout when waiting for AJAX elements in pages, in seconds.- See Also:
- Constant Field Values
-
DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT
public static final java.lang.Integer DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT -
PROJECT_BUILD_DIRECTORY
public static final java.lang.String PROJECT_BUILD_DIRECTORYIf 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:
- Constant Field Values
-
REFUSE_UNTRUSTED_CERTIFICATES
public static final java.lang.String REFUSE_UNTRUSTED_CERTIFICATESBy default, when accepting untrusted SSL certificates, assume that these certificates will come from an untrusted issuer or will be self signed. Due to limitation within Firefox, it is easy to find out if the certificate has expired or does not match the host it was served for, but hard to find out if the issuer of the certificate is untrusted. By default, it is assumed that the certificates were not be issued from a trusted CA. If you are receive an "untrusted site" prompt on Firefox when using a certificate that was issued by valid issuer, but has expired or is being served served for a different host (e.g. production certificate served in a testing environment) set this to false. -
outputDirectory
protected java.io.File outputDirectoryHTML and XML reports will be generated in this directory. -
defaultBaseUrl
protected java.lang.String defaultBaseUrl -
environmentVariables
-
-
Constructor Details
-
SystemPropertiesConfiguration
-
-
Method Details
-
withEnvironmentVariables
public SystemPropertiesConfiguration withEnvironmentVariables(EnvironmentVariables environmentVariables)- Specified by:
withEnvironmentVariables
in interfaceConfiguration
-
getEnvironmentVariables
- Specified by:
getEnvironmentVariables
in interfaceConfiguration
-
loadOutputDirectoryFromSystemProperties
public java.io.File loadOutputDirectoryFromSystemProperties()Where should the reports go? -
loadHistoryDirectoryFromSystemProperties
public java.io.File 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:
getStepDelay
in interfaceConfiguration
-
getElementTimeoutInSeconds
public int getElementTimeoutInSeconds()- Specified by:
getElementTimeoutInSeconds
in interfaceConfiguration
-
getUseUniqueBrowser
@Deprecated public boolean getUseUniqueBrowser()Deprecated.Description copied from interface:Configuration
Use shouldUseAUniqueBrowser() instead- Specified by:
getUseUniqueBrowser
in interfaceConfiguration
-
shouldUseAUniqueBrowser
@Deprecated public boolean shouldUseAUniqueBrowser()Deprecated.- Specified by:
shouldUseAUniqueBrowser
in interfaceConfiguration
-
setOutputDirectory
public void setOutputDirectory(java.io.File outputDirectory)- Specified by:
setOutputDirectory
in interfaceConfiguration
-
getOutputDirectory
public java.io.File 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.- Specified by:
getOutputDirectory
in interfaceConfiguration
-
getHistoryDirectory
public java.io.File getHistoryDirectory()- Specified by:
getHistoryDirectory
in interfaceConfiguration
-
getEstimatedAverageStepCount
public double getEstimatedAverageStepCount()- Specified by:
getEstimatedAverageStepCount
in interfaceConfiguration
-
onlySaveFailingScreenshots
public boolean onlySaveFailingScreenshots()- Specified by:
onlySaveFailingScreenshots
in interfaceConfiguration
-
takeVerboseScreenshots
public boolean takeVerboseScreenshots()Description copied from interface:Configuration
Take a screenshot for each action.- Specified by:
takeVerboseScreenshots
in interfaceConfiguration
-
getScreenshotLevel
Description copied from interface:Configuration
How often should screenshots be taken.- Specified by:
getScreenshotLevel
in interfaceConfiguration
-
setIfUndefined
public void setIfUndefined(java.lang.String property, java.lang.String value)- Specified by:
setIfUndefined
in interfaceConfiguration
-
setDefaultBaseUrl
public void setDefaultBaseUrl(java.lang.String defaultBaseUrl)Override the default base URL manually. Normally only needed for testing.- Specified by:
setDefaultBaseUrl
in interfaceConfiguration
-
getRestartFrequency
public int getRestartFrequency()- Specified by:
getRestartFrequency
in interfaceConfiguration
-
getCurrentTestCount
public int getCurrentTestCount()Description copied from interface:Configuration
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:
getCurrentTestCount
in interfaceConfiguration
-
getBaseUrl
public java.lang.String 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:
getBaseUrl
in interfaceConfiguration
-