Class SystemPropertiesConfiguration

java.lang.Object
net.thucydides.model.configuration.SystemPropertiesConfiguration
All Implemented Interfaces:
Configuration

public class SystemPropertiesConfiguration extends 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

    • PROJECT_BUILD_DIRECTORY

      public static final 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:
    • outputDirectory

      protected File outputDirectory
      HTML reports will be generated in this directory.
    • sourceDirectory

      protected File sourceDirectory
      JSON reports will be read from here
    • defaultBaseUrl

      protected String defaultBaseUrl
    • environmentVariables

      protected EnvironmentVariables environmentVariables
  • Constructor Details

    • SystemPropertiesConfiguration

      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 File loadOutputDirectoryFromSystemProperties()
      Where should the reports go?
    • loadHistoryDirectoryFromSystemProperties

      public 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(File outputDirectory)
      Specified by:
      setOutputDirectory in interface Configuration
    • setSourceDirectory

      public void setSourceDirectory(File sourceDirectory)
      Specified by:
      setSourceDirectory in interface Configuration
    • setProjectDirectory

      public void setProjectDirectory(Path projectDirectory)
      Specified by:
      setProjectDirectory in interface Configuration
    • getProjectDirectory

      public Path getProjectDirectory()
      Specified by:
      getProjectDirectory in interface Configuration
    • getOutputDirectory

      public 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. - 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:
      getOutputDirectory in interface Configuration
    • getSourceDirectory

      public File getSourceDirectory()
    • getHistoryDirectory

      public 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 Optional<TakeScreenshots> getScreenshotLevel()
      Description copied from interface: Configuration
      How often should screenshots be taken.
      Specified by:
      getScreenshotLevel in interface Configuration
    • setIfUndefined

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

      public void setDefaultBaseUrl(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 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