com.opera.core.systems.testing.drivers
Class OperaDriverBuilder

java.lang.Object
  extended by com.opera.core.systems.testing.drivers.OperaDriverBuilder
All Implemented Interfaces:
com.google.common.base.Supplier<OperaDriver>

public class OperaDriverBuilder
extends Object
implements com.google.common.base.Supplier<OperaDriver>

OperaDriverBuilder is a builder that supplies you with instances of OperaDriver through the get() method. You can either use it by specifying a Supplier class or the class it self as a construction argument. Call get() to instantiate a new driver. The Supplier class supplies objects of a single type. Semantically that could be factories, generators, builders, closures, or something else entirely.

Author:
Andreas Tolf Tolfsen

Constructor Summary
OperaDriverBuilder()
          By default, this class provides a plain OperaDriver instance object with the default desired capabilities specified in Selenium's DesiredCapabilities.opera().
OperaDriverBuilder(Class<? extends OperaDriver> driverImplementation)
          You may build a new Opera instance by specifying a custom driver class.
OperaDriverBuilder(OperaDriverSupplier supplier)
          You may build a new Opera instance by specifying an implementation of the Supplier interface.
 
Method Summary
 OperaDriver get()
          Retrieves an instance of OperaDriver.
 OperaDriverBuilder modifyLogLevel(Level level)
          Allows you to override the logging levels specified in the capabilities.
 OperaDriverBuilder using(OperaSettings settings)
          Allows you to specify using which capabilities you'd like the driver to be instantiated with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperaDriverBuilder

public OperaDriverBuilder()
By default, this class provides a plain OperaDriver instance object with the default desired capabilities specified in Selenium's DesiredCapabilities.opera().


OperaDriverBuilder

public OperaDriverBuilder(OperaDriverSupplier supplier)
You may build a new Opera instance by specifying an implementation of the Supplier interface. The supplier may, for instance, perform pre- or post startup steps needed for a custom driver configuration.

Parameters:
supplier - a supplier that implements Supplier.get()

OperaDriverBuilder

public OperaDriverBuilder(Class<? extends OperaDriver> driverImplementation)
You may build a new Opera instance by specifying a custom driver class. The class must extend the OperaDriver implementation.

Parameters:
driverImplementation - class reference to driver implementation
Method Detail

using

public OperaDriverBuilder using(OperaSettings settings)
Allows you to specify using which capabilities you'd like the driver to be instantiated with.

Parameters:
settings - capabilities for the driver
Returns:
a self reference

modifyLogLevel

public OperaDriverBuilder modifyLogLevel(Level level)
Allows you to override the logging levels specified in the capabilities.

Parameters:
level - the logging level you wish the driver to use
Returns:
a self reference

get

public OperaDriver get()
Retrieves an instance of OperaDriver.

Specified by:
get in interface com.google.common.base.Supplier<OperaDriver>
Returns:
an instance of OperaDriver


Copyright © 2012. All Rights Reserved.