Question: Generic catch of unhandled exceptions #593
-
|
In theory an exception could occur in every Gherkin step (Given, When, Then, And, But). We don't want to add a try .. catch block to every call which potentially could lead to an exception. Is there a generic mechanism which catches an unexpected exception and handles this properly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Any exception thrown by a step binding method (Given/When/Then) indicates to the Reqnroll runtime that the test step has failed and to mark that Scenario as failed. Reqnroll even has a set of custom exception types specifically for this purpose, such as the So, we actually want the exceptions to flow out of the step methods. Are there concerns you have beyond that basic behavioral pattern used by Reqnroll? |
Beta Was this translation helpful? Give feedback.
Any exception thrown by a step binding method (Given/When/Then) indicates to the Reqnroll runtime that the test step has failed and to mark that Scenario as failed. Reqnroll even has a set of custom exception types specifically for this purpose, such as the
PendingStepException.So, we actually want the exceptions to flow out of the step methods.
Are there concerns you have beyond that basic behavioral pattern used by Reqnroll?