org.jbehave.web.selenium.PerStoriesWebDriverSteps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbehave-web-selenium Show documentation
Show all versions of jbehave-web-selenium Show documentation
Selenium and WebDriver API bindings for JBehave
The newest version!
package org.jbehave.web.selenium;
import org.jbehave.core.annotations.AfterStories;
import org.jbehave.core.annotations.BeforeStories;
/**
* Steps implementation that can be used before and after lifecycle in
* WebDriver-based stories. It provides annotated methods to initialise
* WebDriver before all stories and quit WebDriver after all stories.
*
*
* NOTE: using this implementation requires the use of a same-thread
* {@link ExecutorService} to be configured in the Embedder, e.g. Guava's
* {@link MoreExecutors.sameThreadExecutor()},
*
*
* @author Paul Hammant
*/
public class PerStoriesWebDriverSteps extends WebDriverSteps {
public PerStoriesWebDriverSteps(WebDriverProvider driverProvider) {
super(driverProvider);
}
@BeforeStories
public void beforeStories() throws Exception {
driverProvider.initialize();
}
@AfterStories
public void afterStories() throws Exception {
driverProvider.end();
}
}