Package at.willhaben.willtest.rule
Class AbstractSeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>
- java.lang.Object
-
- at.willhaben.willtest.rule.TestFailureAwareRule
-
- at.willhaben.willtest.rule.AbstractSeleniumProvider<P,D>
-
- All Implemented Interfaces:
SeleniumProvider<P,D>,org.junit.rules.TestRule
- Direct Known Subclasses:
AbstractFirefoxProvider
@Deprecated public abstract class AbstractSeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver> extends TestFailureAwareRule implements SeleniumProvider<P,D>
Deprecated.Combines the Rule pattern with theSeleniumProvider, so in this class a webDriver is created for a test. This class implements the default cleanup after a test with a created webDriver. Registers and callsWebDriverConfigurationParticipantinstances, which can influence the creation of theWebDriver.
-
-
Field Summary
-
Fields inherited from interface at.willhaben.willtest.config.SeleniumProvider
FIND_ELEMENT_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description AbstractSeleniumProvider()Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PaddWebDriverConfigurationParticipant(WebDriverConfigurationParticipant<D> webDriverConfigurationParticipant)Deprecated.After creating a newWebDriverinstance, aSeleniumProviderimplementation should pass that instance to allWebDriverConfigurationParticipantto let them adjust it.<T extends org.openqa.selenium.support.events.WebDriverEventListener & org.junit.rules.TestRule>
PaddWebDriverEventListener(T listener)Deprecated.protected voidafter(org.junit.runner.Description description, java.lang.Throwable testFailure)Deprecated.Closes the webDriver which was created in this rule.protected voidbefore(org.junit.runner.Description description)Deprecated.Can do something before a test.protected abstract DconstructWebDriver(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)Deprecated.protected org.openqa.selenium.remote.DesiredCapabilitiescreateDesiredCapabilities(org.junit.runner.Description description)Deprecated.org.openqa.selenium.WebDrivergetWebDriver()Deprecated.-
Methods inherited from class at.willhaben.willtest.rule.TestFailureAwareRule
apply, onError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface at.willhaben.willtest.config.SeleniumProvider
getDefaultWebDriverWait, getThis
-
-
-
-
Method Detail
-
getWebDriver
public org.openqa.selenium.WebDriver getWebDriver()
Deprecated.- Specified by:
getWebDriverin interfaceSeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>- Returns:
- a new
WebDriverinstance
-
addWebDriverConfigurationParticipant
public P addWebDriverConfigurationParticipant(WebDriverConfigurationParticipant<D> webDriverConfigurationParticipant)
Deprecated.Description copied from interface:SeleniumProviderAfter creating a newWebDriverinstance, aSeleniumProviderimplementation should pass that instance to allWebDriverConfigurationParticipantto let them adjust it.- Specified by:
addWebDriverConfigurationParticipantin interfaceSeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>- Parameters:
webDriverConfigurationParticipant- participant to be added to the list- Returns:
- the provider itself to make method chaining possible
-
addWebDriverEventListener
public <T extends org.openqa.selenium.support.events.WebDriverEventListener & org.junit.rules.TestRule> P addWebDriverEventListener(T listener)
Deprecated.Description copied from interface:SeleniumProvider- Specified by:
addWebDriverEventListenerin interfaceSeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>- Parameters:
listener- Implementation ofWebDriverEventListener&TestRuleadded to the list of listeners- Returns:
- the provider itself to make method chaining possible
-
before
protected void before(org.junit.runner.Description description) throws java.lang.ThrowableDeprecated.Description copied from class:TestFailureAwareRuleCan do something before a test. By default it does nothing.- Overrides:
beforein classTestFailureAwareRule- Parameters:
description- junit test description object- Throws:
java.lang.Throwable- any error from the test
-
after
protected void after(org.junit.runner.Description description, java.lang.Throwable testFailure) throws java.lang.ThrowableDeprecated.Closes the webDriver which was created in this rule. Takes care if there is an exception while closing the webDriver.- Overrides:
afterin classTestFailureAwareRule- Parameters:
description- junit test description objecttestFailure- in case of failed test it contains an exception. Otherwise null- Throws:
java.lang.Throwable- iftestFailureis null, it will fly, iftestFailureis not null, it will be added to that as suppressed exception. SeeThrowable.addSuppressed(Throwable)
-
constructWebDriver
protected abstract D constructWebDriver(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
Deprecated.
-
createDesiredCapabilities
protected org.openqa.selenium.remote.DesiredCapabilities createDesiredCapabilities(org.junit.runner.Description description)
Deprecated.
-
-