Re: [Cucumber] Provide predefined steps on a java lib

59 views
Skip to first unread message

aslak hellesoy

unread,
May 18, 2013, 10:20:35 PM5/18/13
to Cucumber Users



On Sat, May 18, 2013 at 1:47 PM, Alexis Mas <vodkadec...@gmail.com> wrote:
Hi, I'm trying to develop a java lib

I'm assuming you're using Cucumber-JVM with Java.
 
to provide a set of predefined steps for Android development.


You might want to check out my blog post explaining why we decided to remove predefined steps for Rails.

That said, we also have Aruba - predefined steps for command line apps.
 
On a normal project the structure will have a feature and steps folder for testing the app, but In this case the steps are the lib itself.

So that means steps should be under src/ folder like a normal source file?


I'm assuming you mean step definitions - not steps. (Steps is what you have in gherkin documents).
If you want to reuse stepdefs across projects you have to compile them and package them into a jar.

Is it possible to tell cucumber, "here you can find the steps" ?


Put the jar with the stepdefs on the classpath and tell cucumber what package to look for stepdefs with the --glue option.
 
Would you recommend to test the lib with the lib itself?


I'd recommend a similar testing strategy to what we're doing in Aruba. In your case - a simple app in the same repo that you test your stepdefs against.

Aslak

For example consider this scenario

Given I launch "SampleActivity"
Then Current activity should be "SampleActivity"

Both steps will be defined on the lib, but also can be used to test the lib itself.

Regards,
Alexis.

--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages