2 scenarios (Phone and Desktop), none of them should fail but one silently skip

20 views
Skip to first unread message

phil.k...@gmail.com

unread,
Apr 27, 2015, 1:29:04 AM4/27/15
to cu...@googlegroups.com
I have to test my app for phone and the desktop/tablet. Since it behaves slightly different on both platforms one feature may have different scenarios.
So I guess I will describe 2 scenarios, one for the phone and one for the other platforms.

Scenario:
  Given I am using a phone

Scenario:
  Given I am not using a phone


Both scenarios should run, but one should silently skip (but not fail) depending on the first step. I know I could set the stop to "pending" but I am not sure that this is the smartest way to do that.

Any ideas?

Paolo Ambrosio

unread,
Apr 27, 2015, 2:07:55 AM4/27/15
to cu...@googlegroups.com
You could tag scenarios that work only on phones with @phone, and use
@desktop for the ones that are relevant to the desktop version only.

You can then run all scenarios on the phone excluding those targeted
to the desktop (cucumber --tags ~@desktop) and the other way around.

More information on tags: https://github.com/cucumber/cucumber/wiki/Tags


Paolo

Matt Metzger

unread,
Apr 27, 2015, 10:18:05 AM4/27/15
to cu...@googlegroups.com
Adding to Paolo's suggestion - over time, you may find that there are other differences between your Phone and Desktop tests. You might need to set different environment variables, use different reports, etc.

With that in mind, you might also want to set up a phone and desktop profile. You would then just do "cucumber -p phone" or "cucumber -p desktop" which would handle all of the tags, environment variables, etc.

phil.k...@gmail.com

unread,
Apr 27, 2015, 12:10:25 PM4/27/15
to cu...@googlegroups.com
Thanks for your suggestions. However inside the Windows App I don't have the same freedom as on the CLI. So I have to check whether or not I can use profiles and tags. I guess I could write CLI arguments to a config file and read them out at app start. But how would I feed them to cucumber, how to configure cucumber(-js) in my case?
Reply all
Reply to author
Forward
0 new messages