我目前在当前浏览器上运行 JBehave Selenium 测试,我使用 PropertyWebDriverProvider() 来设置我的浏览器。有我的代码:
公共类 PlayerLandingPageRunner 扩展 JUnitStories {
private WebDriverProvider driverProvider = new PropertyWebDriverProvider();
private WebDriverSteps lifecycleSteps = new PerStoriesWebDriverSteps(driverProvider);
private Pages pages = new Pages(driverProvider);
private SeleniumContext context = new SeleniumContext();
private ContextView contextView = new LocalFrameContextView().sized(500, 100);
public PlayerLandingPageRunner() {
if ( lifecycleSteps instanceof PerStoriesWebDriverSteps ){
configuredEmbedder().useExecutorService(MoreExecutors.sameThreadExecutor());
configuredEmbedder().useMetaFilters(asList("-skip"));
}
}
@Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
return new SeleniumConfiguration()
.useSeleniumContext(context)
.useWebDriverProvider(driverProvider)
.useStepMonitor(new SeleniumStepMonitor(contextView, context, new SilentStepMonitor()))
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(codeLocationFromClass(embeddableClass))
.withDefaultFormats()
.withFormats(CONSOLE, TXT, HTML, XML));
}
...
如何设置它以在其他浏览器上运行?IE,铬?
谢谢!