custom Exception handling in step of test

Get help with testing, discuss unit testing strategies etc.


Post Reply
User avatar
hgalstyan
Posts: 3
Joined: Mon Apr 13, 2020 10:36 pm

custom Exception handling in step of test

Post 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?

User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: custom Exception handling in step of test

Post by nickolay »

We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
hgalstyan
Posts: 3
Joined: Mon Apr 13, 2020 10:36 pm

Re: custom Exception handling in step of test

Post 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?

User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: custom Exception handling in step of test

Post 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.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
hgalstyan
Posts: 3
Joined: Mon Apr 13, 2020 10:36 pm

Re: custom Exception handling in step of test

Post by hgalstyan »

Thanks again, I made a custom function which is missing the call to me.fail() inside done and we're sorted.

Post Reply