Hi,

well, what other behaviour did you expect?

The intended one is that if you provide some parameters to the composing step, these parameter values are passed to the composite steps (where appropriate).

So you should userId=Agatha passed to the steps that declare the @Named("userId").

If you provide a working example project, we can investigate further.

Cheers

On 22/04/2013 18:23, Karlsson Christian wrote:

Hello

I'm trying to use composite steps in my scenarios. Right now I'm facing a situation I can't get to work and I wonder if I'm doing it wrong or if my use case is out of scope.

Reproducing steps:

@Given("user $userId logs on first")

@Composite(steps = {

"Given that user <userId> has logged in",

"When the user logs out",

"When user Charlie has logged in",

           "When the user logs out",

"When user Dickens has logged in",

"When the user logs off,"

           "When <userId> user has logged in",

"When the user logs off"})

*public**void*logTest(@Named("userId")

String userId) *throws*Exception {

    }

@Given("that user <userId> has logged in")

@When("user $userId has logged in")

*public**void*login(@Named("userId")

String userId) *throws*Exception {

    }

Scenario: Test composite steps

Givenuser Agatha logs on first

I get user "Agatha" as the userId in all my steps. Is that the intended behavior?

Regards,

Christian

**

*Christian Karlsson*

CAG Contactor AB

Adress: Jan Stenbecks Torg 17, SE-164 40 Kista
Mobil: +46 (0)706694527

Mail: christian.karlsson <at> cag.se
www.cag.se <https://wmail.cag.se/owa/redir.aspx?C=G2EjVQkj7kGZyieqy24uGB6NV2uAkM9Iy3xqV4cZFUaEVGXCGlWIq_V5O25t1jIUtjHgAaGFl0U.&URL=http%3a%2f%2fwww.cag.se%2f>


Reply via email to