Page 1 of 1

custom Exception handling in step of test

Posted: Mon Apr 13, 2020 10:48 pm
by hgalstyan
I've run into an issue where Ext raises an exception during a step in a test (due to a weird bug in the core) and I am not able to prevent the scenario which creates the exception, so I want to ignore it. I know that Siesta has an option transparentEx, but that seems to be for the whole project and not a single test.

Is there another option (a config or a strategy) to disable automatic exception handling for a single test and then fail the test if the caught exception with our own handler is not a known exception?

Re: custom Exception handling in step of test

Posted: Tue Apr 14, 2020 11:02 am
by nickolay

Re: custom Exception handling in step of test

Posted: Tue Apr 14, 2020 12:10 pm
by hgalstyan
Thanks Nickolay, that seems to do the trick, (although since that function expects an exception, we get warnings when there is none, since the bug is intermittent). I don't think there's a function to handle that case right?

Re: custom Exception handling in step of test

Posted: Tue Apr 14, 2020 12:14 pm
by nickolay
Hm.. Yes, it always expects an exception. You may need to create your own version of `throwsOkAsync` (check the sources), which will be ignoring the case when the exception is not thrown.

Re: custom Exception handling in step of test

Posted: Tue Apr 14, 2020 12:40 pm
by hgalstyan
Thanks again, I made a custom function which is missing the call to me.fail() inside done and we're sorted.