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 Details

    • DEFAULT_ELEMENT_TIMEOUT_SECONDS

      public static final int DEFAULT_ELEMENT_TIMEOUT_SECONDS
      Default 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_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:
      Constant Field Values
    • REFUSE_UNTRUSTED_CERTIFICATES

      public static final 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. 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 outputDirectory
      HTML and XML reports will be generated in this directory.
    • defaultBaseUrl

      protected java.lang.String defaultBaseUrl
    • environmentVariables

      protected EnvironmentVariables environmentVariables
  • Constructor Details

    • SystemPropertiesConfiguration

      @Inject public SystemPropertiesConfiguration​(EnvironmentVariables environmentVariables)
  • Method Details

    • withEnvironmentVariables

      public SystemPropertiesConfiguration withEnvironmentVariables​(EnvironmentVariables environmentVariables)
      Specified by:
      withEnvironmentVariables in interface Configuration
    • getEnvironmentVariables

      public EnvironmentVariables getEnvironmentVariables()
      Specified by:
      getEnvironmentVariables in interface Configuration
    • 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 interface Configuration
    • getElementTimeoutInSeconds

      public int getElementTimeoutInSeconds()
      Specified by:
      getElementTimeoutInSeconds in interface Configuration
    • getUseUniqueBrowser

      @Deprecated public boolean getUseUniqueBrowser()
      Deprecated.
      Description copied from interface: Configuration
      Use shouldUseAUniqueBrowser() instead
      Specified by:
      getUseUniqueBrowser in interface Configuration
    • shouldUseAUniqueBrowser

      @Deprecated public boolean shouldUseAUniqueBrowser()
      Deprecated.
      Specified by:
      shouldUseAUniqueBrowser in interface Configuration
    • setOutputDirectory

      public void setOutputDirectory​(java.io.File outputDirectory)
      Specified by:
      setOutputDirectory in interface Configuration
    • 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 interface Configuration
    • getHistoryDirectory

      public java.io.File getHistoryDirectory()
      Specified by:
      getHistoryDirectory in interface Configuration
    • getEstimatedAverageStepCount

      public double getEstimatedAverageStepCount()
      Specified by:
      getEstimatedAverageStepCount in interface Configuration
    • onlySaveFailingScreenshots

      public boolean onlySaveFailingScreenshots()
      Specified by:
      onlySaveFailingScreenshots in interface Configuration
    • takeVerboseScreenshots

      public boolean takeVerboseScreenshots()
      Description copied from interface: Configuration
      Take a screenshot for each action.
      Specified by:
      takeVerboseScreenshots in interface Configuration
    • getScreenshotLevel

      public java.util.Optional<TakeScreenshots> getScreenshotLevel()
      Description copied from interface: Configuration
      How often should screenshots be taken.
      Specified by:
      getScreenshotLevel in interface Configuration
    • setIfUndefined

      public void setIfUndefined​(java.lang.String property, java.lang.String value)
      Specified by:
      setIfUndefined in interface Configuration
    • setDefaultBaseUrl

      public void setDefaultBaseUrl​(java.lang.String defaultBaseUrl)
      Override the default base URL manually. Normally only needed for testing.
      Specified by:
      setDefaultBaseUrl in interface Configuration
    • getRestartFrequency

      public int getRestartFrequency()
      Specified by:
      getRestartFrequency in interface Configuration
    • 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 interface Configuration
    • 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 interface Configuration