public abstract class AbstractSeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver> extends TestFailureAwareRule implements SeleniumProvider<P,D>
SeleniumProvider, 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 calls
WebDriverConfigurationParticipant instances, which can influence the creation of the WebDriver.FIND_ELEMENT_TIMEOUT| Constructor and Description |
|---|
AbstractSeleniumProvider() |
| Modifier and Type | Method and Description |
|---|---|
P |
addWebDriverConfigurationParticipant(WebDriverConfigurationParticipant<D> webDriverConfigurationParticipant)
After creating a new
WebDriver instance, a SeleniumProvider implementation should pass that instance
to all WebDriverConfigurationParticipant to let them adjust it. |
<T extends org.openqa.selenium.support.events.WebDriverEventListener & org.junit.rules.TestRule> |
addWebDriverEventListener(T listener)
|
protected void |
after(org.junit.runner.Description description,
Throwable testFailure)
Closes the webDriver which was created in this rule.
|
protected void |
before(org.junit.runner.Description description)
Can do something before a test.
|
protected abstract D |
constructWebDriver(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities) |
protected org.openqa.selenium.remote.DesiredCapabilities |
createDesiredCapabilities(org.junit.runner.Description description) |
org.openqa.selenium.WebDriver |
getWebDriver() |
apply, onErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultWebDriverWait, getThispublic org.openqa.selenium.WebDriver getWebDriver()
getWebDriver in interface SeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>WebDriver instancepublic P addWebDriverConfigurationParticipant(WebDriverConfigurationParticipant<D> webDriverConfigurationParticipant)
SeleniumProviderWebDriver instance, a SeleniumProvider implementation should pass that instance
to all WebDriverConfigurationParticipant to let them adjust it.addWebDriverConfigurationParticipant in interface SeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>webDriverConfigurationParticipant - participant to be added to the listpublic <T extends org.openqa.selenium.support.events.WebDriverEventListener & org.junit.rules.TestRule> P addWebDriverEventListener(T listener)
SeleniumProvideraddWebDriverEventListener in interface SeleniumProvider<P extends SeleniumProvider<P,D>,D extends org.openqa.selenium.WebDriver>listener - Implementation of WebDriverEventListener & TestRule added to the list of listenersprotected void before(org.junit.runner.Description description)
throws Throwable
TestFailureAwareRulebefore in class TestFailureAwareRuledescription - junit test description objectThrowable - any error from the testprotected void after(org.junit.runner.Description description,
Throwable testFailure)
throws Throwable
after in class TestFailureAwareRuledescription - junit test description objecttestFailure - in case of failed test it contains an exception. Otherwise nullThrowable - if testFailure is null, it will fly, if testFailure is not null,
it will be added to that as suppressed exception. See Throwable.addSuppressed(Throwable)protected abstract D constructWebDriver(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
protected org.openqa.selenium.remote.DesiredCapabilities createDesiredCapabilities(org.junit.runner.Description description)
Copyright © 2018 willhaben internet service GmbH & Co KG. All rights reserved.