ruby - How do I conditionally skip a scenario in Cucumber? -


how conditionally skip scenario?

for example, wish continue scenario if conditions met, not want register failure if it's not present.

this issue had. tests write against ui has changing database unable have static data in. means times possible there no data test. not pass not fail, unable run.

the way found work best invoke cucumber pending.

example test:

scenario: test application   given application has data   when test   result 

example step def:

given /^my application has data$/   pending unless application.has_data? end 

these kind of results can see:

201 scenarios (15 pending, 186 passed) 1151 steps (15 pending, 1136 passed) 

it's worth noting have debugging , have these tests tagged @ time can run these pending tests again.

hope helps, ben.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -