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 int DEFAULT_ELEMENT_TIMEOUT_SECONDS
          Default timeout when waiting for AJAX elements in pages, in milliseconds.
static Integer DEFAULT_ESTIMATED_AVERAGE_STEP_COUNT
           
static String DEFAULT_WEBDRIVER_DRIVER
          The default browser is Firefox.
static String MAX_RETRIES
           
static String OUTPUT_DIRECTORY_PROPERTY
          Use this property to define the output directory in which reports will be stored.
static 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.
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
 Configuration copy()
           
 String getBaseUrl()
          This is the URL where test cases start.
 int getCurrentTestCount()
          This is the URL where test cases start.
 SupportedWebDriver getDriverType()
          Get the currently-configured browser type.
 int getElementTimeout()
           
 EnvironmentVariables getEnvironmentVariables()
           
 double getEstimatedAverageStepCount()
           
 File getOutputDirectory()
          The output directory is where the test runner writes the XML and HTML reports to.
 int getRestartFrequency()
           
 com.google.common.base.Optional<TakeScreenshots> getScreenshotLevel()
          How often should screenshots be taken.
 int getStepDelay()
           
 boolean getUseUniqueBrowser()
           
 File loadOutputDirectoryFromSystemProperties()
          Where should the reports go?
 int maxRetries()
           
 boolean onlySaveFailingScreenshots()
           
 void setDefaultBaseUrl(String defaultBaseUrl)
          Override the default base URL manually.
 void setIfUndefined(String property, String value)
           
 void setOutputDirectory(File outputDirectory)
           
 boolean storeHtmlSourceCode()
           
 boolean takeVerboseScreenshots()
          Take a screenshot for each action.
 Configuration withEnvironmentVariables(EnvironmentVariables environmentVariables)
           
 
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 static 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.


REFUSE_UNTRUSTED_CERTIFICATES

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


MAX_RETRIES

public static final String MAX_RETRIES
See Also:
Constant Field Values
Constructor Detail

SystemPropertiesConfiguration

@Inject
public SystemPropertiesConfiguration(EnvironmentVariables environmentVariables)
Method Detail

copy

public Configuration copy()
Specified by:
copy in interface Configuration

withEnvironmentVariables

public Configuration withEnvironmentVariables(EnvironmentVariables environmentVariables)
Specified by:
withEnvironmentVariables in interface Configuration

getEnvironmentVariables

public EnvironmentVariables getEnvironmentVariables()
Specified by:
getEnvironmentVariables in interface Configuration

maxRetries

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

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?


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()
Description copied from interface: Configuration
Take a screenshot for each action.

Specified by:
takeVerboseScreenshots in interface Configuration

getScreenshotLevel

public com.google.common.base.Optional<TakeScreenshots> getScreenshotLevel()
Description copied from interface: Configuration
How often should screenshots be taken.

Specified by:
getScreenshotLevel in interface Configuration

storeHtmlSourceCode

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


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