public abstract class GrapheneContext extends Object
Allows to access current browser instance and configuration.
One needs to know the qualifier of a browser injected via @Drone annotation. The injection point can have qualifier.
If no qualifier is specified, Default
qualifier be used.
Constructor and Description |
---|
GrapheneContext() |
Modifier and Type | Method and Description |
---|---|
abstract GrapheneConfiguration |
getConfiguration()
Returns configuration for the context
|
static GrapheneContext |
getContextFor(Class<?> qualifier)
Get context associated to the given qualifier.
|
abstract Class<?> |
getQualifier() |
abstract org.openqa.selenium.WebDriver |
getWebDriver(Class<?>... interfaces)
If the
WebDriver instance is not available yet, the returned proxy just implements WebDriver interface. |
static GrapheneContext |
lastContext()
Returns last known context which has been access by a test
|
static void |
removeContextFor(Class<?> qualifier)
Removes the context associated to the given qualifier.
|
static GrapheneContext |
setContextFor(GrapheneConfiguration configuration,
org.openqa.selenium.WebDriver driver,
Class<?> qualifier)
Creates a new context for the given webdriver, configuration and qualifier.
|
public abstract Class<?> getQualifier()
public abstract org.openqa.selenium.WebDriver getWebDriver(Class<?>... interfaces)
WebDriver
instance is not available yet, the returned proxy just implements WebDriver
interface.
If the WebDriver
instance is available, its class is used to create a proxy, so the proxy extends it.interfaces
- interfaces which should be implemented by the returned WebDriver
WebDriver
held in the contextpublic abstract GrapheneConfiguration getConfiguration()
public static GrapheneContext lastContext()
public static GrapheneContext getContextFor(Class<?> qualifier)
Default
qualifier is given, the returned context tries to
resolves the active context before each method invocation. If the active context is available, the returned context
behaves like the active one.public static GrapheneContext setContextFor(GrapheneConfiguration configuration, org.openqa.selenium.WebDriver driver, Class<?> qualifier)
removeContextFor(java.lang.Class)
after the context is no longer valid.getContextFor(java.lang.Class)
,
removeContextFor(java.lang.Class)
public static void removeContextFor(Class<?> qualifier)
qualifier
- setContextFor(org.jboss.arquillian.graphene.spi.configuration.GrapheneConfiguration, org.openqa.selenium.WebDriver,
java.lang.Class)
Copyright © 2016 JBoss by Red Hat. All rights reserved.