Run Specific Tests / Scenarios instead of entire feature file?

6,933 views
Skip to first unread message

Tony Montgomery

unread,
Sep 12, 2012, 5:40:41 PM9/12/12
to calabash...@googlegroups.com
Great software. I have been checking it out for a week or so.
I've browsed all the topics but did not see my specific question.

Let's assume I have many feature files, with each having many scenerios.
How can I run a specific feature scenerio, instead of the entire feature file?

For example:

Let's say i have the following.

My_A_Tests.feature
-Scenerio1
-Scenerio2

My_B_Tests.feature
-Scenerio1
-Scenerio2
-Scenerio3
-Scenerio4

My_C_Tests.feature
-Scenerio1
-Scenerio2
-Scenerio3

How do I ask Calabash to run "My_B_Tests / Scenerio2"?(only)

or even better...

How can I ask Calabash to run "My_B_Tests / Scenerio2", then run "My_C_Tests / Scenerio3", then finally run "My_A_Tests / Scenerio2"?



Regards,


-Tony

Nicholas Albion

unread,
Sep 12, 2012, 8:31:09 PM9/12/12
to calabash...@googlegroups.com
One of the many features I like about cucumber is that you can assign 0-many tags to each Scenario or Feature.

I run cucumber with various combinations of the following tags:

  --tags @this_one  (used as a short-term tag so that I can run only specific scenario(s))
  --tags ~@known_to_pass   (skip all scenarios that I know always pass, so that I can concentrate on tests that always or sometimes fail
  --tags ~@known_to_fail  (as above, also I can do a File Search/grep for "known_to_pass"/"known_to_fail" and update my boss on the state of the project/test cases
  --tags @BUG_XYZ (run/locate/count all scenarios related to a specific bug/issue)
  --tags @skip  (skip all scenarios that are known to fail and cause subsequent test cases to fail)
  --tags @ios --tags ~@android  (run only scenarios that apply to iPhone/iPad, but not to Android)

Tony Montgomery

unread,
Sep 13, 2012, 10:29:25 AM9/13/12
to calabash...@googlegroups.com
Thanks so much! That worked.

Sabhapathi A

unread,
Jan 1, 2013, 6:58:45 PM1/1/13
to calabash...@googlegroups.com
Hi...I am facing similar issue.
I am new...so, I do not know How exactly I can tag a scenario/feature
Is it in file name or inside the file.

And continuation query: How can I reuse that tagging.

A example would help.

Sabhapathi A

unread,
Jan 1, 2013, 7:10:55 PM1/1/13
to calabash...@googlegroups.com
Please ignore my question:

sry...I should have seen "https://github.com/cucumber/cucumber/wiki/Tags"
Before asking this question.
Link above helped me...

Thanks.
-Sabha
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Rafael Alves

unread,
Aug 21, 2015, 7:55:46 PM8/21/15
to calabash-android
I still would like to know the answer because of my implementation, which needs to make reference to the feature and the scenario...

Rafael Alves

unread,
Aug 21, 2015, 7:56:29 PM8/21/15
to calabash-android
Without using tags...

Roberts Krūms

unread,
Aug 19, 2016, 12:13:34 PM8/19/16
to calabash-android
Basically, you can specify the feature file and the line of that scenario, i.e

cucumber features/very_cool_feature.feature:5



 https://www.relishapp.com/cucumber/cucumber/docs/cli/run-specific-scenarios
Reply all
Reply to author
Forward
0 new messages