Hi,
I am using Jbehave with Appium in a project. You can basically use Jbehave Web for Selenium.
To get it working you have to implement the WebDriverProvide interface. The class has to provide the Appium IOSDriver or Android driver. This driver provider class you just pass to the SeleniumConfiguration using the useWebDriverProvider method. This should do the basic setup.
In my project I am running stories in parallel, so I overwrite the DelegatingWebDriverProvider class. It looks similar like this:
public class MyIosDriverProvider extends DelegatingWebDriverProvider {
private DesiredCapabilities iosCapabilities;
private URL hubUrl;
public MyIosDriverProvider(DesiredCapabilities iosCapabilities, URL hubUrl) {
this.iosCapabilities = iosCapabilities;
this.hubUrl = hubUrl;
}
private IOSDriver createDriver() {
return new IOSDriver(hubUrl, iosCapabilities);
}
@Override
public void initialize() {
delegate.set(createDriver());
}
public IOSDriver getAppDriver() {
if (delegate.get() != null) {
return (IOSDriver)delegate.get() ;
}
return null;
}
I pass an object of this class to the step definition classes, so I am able the use the getAppDriver method to get the app driver and use Appium specific methods like resetApp().