org.stjs.testing.driver.browser
Interface Browser

All Superinterfaces:
AsyncProcess
All Known Implementing Classes:
AbstractBrowser, ChromeBrowser, DesktopDefaultBrowser, FirefoxBrowser, HeadlessBrowser, HeadlessChromeBrowser, HeadlessFirefoxBrowser, LongPollingBrowser, PhantomjsBrowser, RemoteBrowser, RhinoBrowser

public interface Browser
extends AsyncProcess

Handles all the details of starting and stopping a testing session as well as executing individual tests for the specific browser represented by the implementation of this interface. Implementations will typically start an internal HTTP server and an external browsers, instruct that browser and instruct the browser how to communicate with the HTTP server.

Author:
lordofthepigs

Method Summary
 void executeTest(MultiTestMethod method)
          Executes the specified test method on this browser, possibly asynchronously.
 DriverConfiguration getConfig()
           
 Set<Class<? extends AsyncProcess>> getSharedDependencies()
          Returns a list of AsyncProcess that the JUnit session must start before attempting to start this browser.
 void notifyNoMoreTests()
          Notifies this browser that there are no more tests to execute.
 void start()
          Starts the browser session.
 void stop()
          Stops this browsers and performs cleanup operations, if any.
 

Method Detail

start

void start()
           throws org.junit.runners.model.InitializationError
Starts the browser session. This will open a browser and navigate it to some page where the unit testing procedure can be started. The decision about exactly which browser binary is started, how it is started and which page is opened is delegated to the Browser implementation that this AsynBrowserSession was constructed with. This method is non-blocking and returns as soon as possible.

Specified by:
start in interface AsyncProcess
Throws:
org.junit.runners.model.InitializationError

getConfig

DriverConfiguration getConfig()

executeTest

void executeTest(MultiTestMethod method)
Executes the specified test method on this browser, possibly asynchronously.

Parameters:
method - The test to execute.

notifyNoMoreTests

void notifyNoMoreTests()
Notifies this browser that there are no more tests to execute.


stop

void stop()
Stops this browsers and performs cleanup operations, if any.

Specified by:
stop in interface AsyncProcess

getSharedDependencies

Set<Class<? extends AsyncProcess>> getSharedDependencies()
Returns a list of AsyncProcess that the JUnit session must start before attempting to start this browser. If any of the dependencies fails to start, the JUnit session fails.



Copyright © 2013. All Rights Reserved.