net.thucydides.core.webdriver
Class SystemPropertiesConfiguration

Package class diagram package SystemPropertiesConfiguration
java.lang.Object
  extended by net.thucydides.core.webdriver.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 Summary
static String ASSUME_UNTRUSTED_CERTIFICATE_ISSUER
          By default, when accepting untrusted SSL certificates, assume that these certificates will come from an untrusted issuer or will be self signed.
static int DEFAULT_ELEMENT_TIMEOUT_SECONDS
          Default timeout when waiting for AJAX elements in pages, in milliseconds.
 Integer DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT
           
static String DEFAULT_WEBDRIVER_DRIVER
          The default browser is Firefox.
static String OUTPUT_DIRECTORY_PROPERTY
          Use this property to define the output directory in which reports will be stored.
static String WEBDRIVER_DRIVER
          Use the 'webdriver.driver' property to tell Thucydides what browser to run the tests in.
 
Constructor Summary
SystemPropertiesConfiguration(EnvironmentVariables environmentVariables)
           
 
Method Summary
 String getBaseUrl()
          This is the URL where test cases start.
 SupportedWebDriver getDriverType()
          Get the currently-configured browser type.
 int getElementTimeout()
           
protected  EnvironmentVariables getEnvironmentVariables()
           
 double getEstimatedAverageStepCount()
           
 File getOutputDirectory()
          The output directory is where the test runner writes the XML and HTML reports to.
 int getRestartFrequency()
           
 int getStepDelay()
           
 boolean getUseUniqueBrowser()
           
 File loadOutputDirectoryFromSystemProperties()
          Where should the reports go?
 boolean onlySaveFailingScreenshots()
           
 void setDefaultBaseUrl(String defaultBaseUrl)
          Override the default base URL manually.
 void setOutputDirectory(File outputDirectory)
           
 boolean takeVerboseScreenshots()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEBDRIVER_DRIVER

public static final String WEBDRIVER_DRIVER
Use the 'webdriver.driver' property to tell Thucydides what browser to run the tests in.


DEFAULT_WEBDRIVER_DRIVER

public static final String DEFAULT_WEBDRIVER_DRIVER
The default browser is Firefox.

See Also:
Constant Field Values

DEFAULT_ELEMENT_TIMEOUT_SECONDS

public static final int DEFAULT_ELEMENT_TIMEOUT_SECONDS
Default timeout when waiting for AJAX elements in pages, in milliseconds.

See Also:
Constant Field Values

DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT

public final Integer DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT

OUTPUT_DIRECTORY_PROPERTY

public static final String OUTPUT_DIRECTORY_PROPERTY
Use this property to define the output directory in which reports will be stored.


ASSUME_UNTRUSTED_CERTIFICATE_ISSUER

public static final String ASSUME_UNTRUSTED_CERTIFICATE_ISSUER
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.

Constructor Detail

SystemPropertiesConfiguration

@Inject
public SystemPropertiesConfiguration(EnvironmentVariables environmentVariables)
Method Detail

getEnvironmentVariables

protected EnvironmentVariables getEnvironmentVariables()

getDriverType

public SupportedWebDriver getDriverType()
Get the currently-configured browser type.

Specified by:
getDriverType in interface Configuration

loadOutputDirectoryFromSystemProperties

public File loadOutputDirectoryFromSystemProperties()
Where should the reports go?

Specified by:
loadOutputDirectoryFromSystemProperties in interface Configuration

getStepDelay

public int getStepDelay()
Specified by:
getStepDelay in interface Configuration

getElementTimeout

public int getElementTimeout()
Specified by:
getElementTimeout in interface Configuration

getUseUniqueBrowser

public boolean getUseUniqueBrowser()
Specified by:
getUseUniqueBrowser in interface Configuration

setOutputDirectory

public void setOutputDirectory(File outputDirectory)
Specified by:
setOutputDirectory 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/thucydides', 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

getEstimatedAverageStepCount

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

onlySaveFailingScreenshots

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

takeVerboseScreenshots

public boolean takeVerboseScreenshots()
Specified by:
takeVerboseScreenshots 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

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


Copyright © 2011-2012 Wakaleo Consulting. All Rights Reserved.