Hi Karlsson,
Yes you are using parameterized steps/scenarios 
(http://jbehave.org/reference/stable/parametrised-scenarios.html)
Any time you use $param in a step that will be replaced with the actual word in 
your story (in this case Agatha)

Thanks,
Enrique

From: Karlsson Christian [mailto:[email protected]]
Sent: Monday, April 22, 2013 9:23 AM
To: [email protected]
Subject: [jbehave-user] Using composite steps

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
Given user 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