Is it possible to define JBehave Web steps in Groovy? There is an
example in the user doc for the plain JBehave. But in case of JBehave
Web, should I use GroovyStepsFactory or InstanceStepsFactory?
When I try to use InstanceStepsFactory with steps defined in a Groovy
class, no stories are found. In my naive approach I simply changed all
.java source files to .groovy and compiled them with groovyc.
If I try to use GroovyStepsFactory, how do I add
PerStoriesWebDriverSteps and WebDriverScreenshotOnFailure?
Below you find my preliminary code for JUnitStories.candidateSteps()
for Groovy and Java:
public class InvoiceMeStories extends JUnitStories {
// GROOVY VERSION
@Override
public List<CandidateSteps> candidateSteps() {
GroovyResourceFinder resourceFinder = new
GroovyResourceFinder(codeLocationFromPath("src/main/groovy"),
"**/*.story", "");
return new GroovyStepsFactory(configuration(), new
GroovyContext(resourceFinder)).createCandidateSteps();
}
// JAVA VERSION
@Override
public List<CandidateSteps> candidateSteps() {
return new InstanceStepsFactory(configuration(),
new CustomerSteps(new CustomerPageFactory(driverProvider)),
new PerStoriesWebDriverSteps(driverProvider), // or
PerStoryWebDriverSteps or PerScenarioWebDriverSteps
new
WebDriverScreenshotOnFailure(driverProvider)).createCandidateSteps();
}
}
Best regards/mit freundlichen GrĂ¼ssen/Saludos cordiales/Pozdrowienia
Marcin Gryszko
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email