de.ppi.selenium.junit.WebServerRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webtest Show documentation
Show all versions of webtest Show documentation
Some additional helper for webtesting with selenium
package de.ppi.selenium.junit;
import org.junit.rules.ExternalResource;
import de.ppi.selenium.browser.SessionManager;
/**
* Junit-Rule to start a webserver.
*
*/
public class WebServerRule extends ExternalResource {
/**
* The webserver.
*/
private final WebServer webServer;
/**
*
* Initiates an object of type WebServerRule.
*
* @param webServer the webserver.
*/
public WebServerRule(WebServer webServer) {
this.webServer = webServer;
SessionManager.getInstance().setDefaultBaseUrl(webServer.getBaseUrl());
}
@Override
protected void before() throws Throwable {
if (!webServer.isRunning()) {
webServer.start();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy