I am more or less using the example for page objects from
http://jbehave.org/reference/web/stable/using-selenium.html, which uses
step constructors with a parameter, I guess I'll look into using DI to
replace that.


On Fri, Dec 23, 2011 at 12:27 AM, Cristiano Gavião <[email protected]>wrote:

> Hi,
>
> Don't know if using a Step class constructor with parameter would be a
> good practice...
>
> If you have the need to access objects inside you Step class try to
> improve your tests with the power of some DI to inject all desired object
> (including you page objects). Jbehave let you work with Guice, Pico and
> Spring. There are examples for each one.
>
> cheers
>
> Cristiano
>
>
>
>
> On 22/12/11 19:26, Alexander Lehmann wrote:
>
>> I have started using AnnotatedPathRunner to run stories as Junit in
>> eclipse, based on the TraderAnnotatedPathRunner example.
>>
>> This works well for Step classes that do not have parameters in the
>> constructor by listing the classes in the @UsingSteps annotation.
>>
>> I have no idea, however, how this should work with steps classes that
>> require a constructor with parameters (e.g. steps using page objects). As I
>> understand this is usually done by implementing an InjectableStepsFactory,
>> but I have no idea where to put that in the annotation version.
>>
>> bye, Alexander
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe from this list, please visit:
>>
>>   
>> http://xircles.codehaus.org/**manage_email<http://xircles.codehaus.org/manage_email>
>>
>>
>>
>

Reply via email to