Is there any more elegant way to fail a step other than raising exception #1915
samuelbenison
started this conversation in
General
Replies: 1 comment 2 replies
-
In Gauge's view, a step would fail when it does not meet a desired outcome. The best way to ascertain that would be to use an assertion library, which can be set to throw contextual and crisp messages. Other than raising an exception, there's no way of telling Gauge to fail a step. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
I have a question, not sure if it has been asked before, if so my apologies.
Is there any more elegant way to fail a step other than raising an exception (for example assertion error)?
When I assert fail a step, it throws an exception along with stack trace in the step, which is nice for some unexpected failures, but I would like to control that exception and return a more elegant way to fail the step maybe by adding a log message, etc for some steps.
Is it possible to do that? I tried to return 'False' for the gauge step implementation function but it is not failing the actual step.
Is there any way to achieve that? appreciate any and all suggestions.
Thanks
P.S: I am using gauge via Python.
Beta Was this translation helpful? Give feedback.
All reactions