Call an entire feature file from within another feature file

1,338 views
Skip to first unread message

Noffica

unread,
Dec 18, 2014, 7:59:32 PM12/18/14
to calabash...@googlegroups.com
Is it possible to call an entire feature file from inside another feature file?

I know it is possible to group multiple steps under one new step as shown here.

Sher Bhachu

unread,
Feb 25, 2015, 12:51:46 PM2/25/15
to calabash...@googlegroups.com
Sounds like a code smell here. This isn't something you would really want to do.

Have you considered using 'Background' if you're using cucumber?

If you have an example of what you're trying to do and why, maybe we could help you come up with a clean solution?

Nauman Mithani

unread,
Mar 3, 2015, 9:00:32 PM3/3/15
to calabash...@googlegroups.com
A Background would run those steps prior to every scenario, which is not needed.

Let's say the AUT has an address book like component. I already have a feature file where I test the creation of a new contact.

If I wish to test the creation of a Linked Contact, which needs a regular contact, can I just call the feature file which creates a regular contact? Rather than include all the steps which create a regular contact in the feature file of a Linked Contact.

Sher Bhachu

unread,
Mar 4, 2015, 3:32:04 AM3/4/15
to calabash...@googlegroups.com
You could simply create a small feature file that does this and use cucumbers ability to call other steps and wrap that in a single step...that would achieve the same.

Consider creating test data like this by using an API call or something, it's so much cleaner.
--
You received this message because you are subscribed to a topic in the Google Groups "calabash-android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/calabash-android/SM6ZqhGij_E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to calabash-andro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tobias....@xamarin.com

unread,
Mar 4, 2015, 4:54:57 AM3/4/15
to calabash...@googlegroups.com
We don't recommend you do this at all as Cucumber is not a programming language. Avoid the `step`, `macro` and other such methods.

You should instead make a Ruby method that performs you task
Reply all
Reply to author
Forward
0 new messages