Hi Marcin,
web steps are qualitatively no different from core steps, the only
different being that they wrap Selenium (or other web tool).
If you want to use groovy to write your steps, you should use the
GroovyStepsFactory.
What is the problem you're finding?
Cheers
On 10/12/2010 09:44, Marcin Gryszko wrote:
> 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
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email