public abstract class JunitWebTest extends Object implements WebTest
TestRetrier
: retries a failing testBrowserManager
: closes the registered browsers as soon as a test finishesHtmlReporter
: generated an HTML report with screenshotsTestWatcher
: logs the state of the running test (e.g.: "passed", "failed")In order for BrowserManager to do its job, each test must register every Browser it opens to the BrowserManager. E.g.:
public void before() {
super.before();
user = new User();
browserManager.registerBrowsers(user.getBrowser());
}
Also, JunitWebTest leverages JUnit's Parameterized
runner to provide the ability
to run each test on many different browsers, which can be specified in the config file.
Modifier and Type | Field and Description |
---|---|
protected BrowserManager |
browserManager |
SupportedBrowser |
browserType |
protected HtmlReporter |
htmlReporter |
protected static org.apache.log4j.Logger |
logger |
static int |
MAX_EXECUTIONS |
protected TestRetrier |
retryRule |
org.junit.rules.TestRule |
ruleChain |
protected org.junit.rules.TestWatcher |
testLogger |
Constructor and Description |
---|
JunitWebTest() |
Modifier and Type | Method and Description |
---|---|
void |
after()
Empty after method.
|
void |
before()
Empty before method.
|
static Collection<Object[]> |
browsers()
Provides the test parameters,
i.e.
|
public static final int MAX_EXECUTIONS
Config.getMaxExecutions()
protected static final org.apache.log4j.Logger logger
protected TestRetrier retryRule
protected BrowserManager browserManager
protected HtmlReporter htmlReporter
protected org.junit.rules.TestWatcher testLogger
public org.junit.rules.TestRule ruleChain
public SupportedBrowser browserType
public static Collection<Object[]> browsers()
Config.getBrowsers()
public void after()
public void before()
Copyright © 2015. All rights reserved.