paypal / nemo-screenshot

Plugin for Nemo testing framework for adapting selenium screenshot capabilities
Other
12 stars 26 forks source link

fix for issue #21. resolves undefined session errors, by not attempti… #28

Closed grawk closed 9 years ago

grawk commented 9 years ago

…ng to capture screenshots when no session is available

grawk commented 9 years ago

Also I found another test case to use where it seems the "flow.once" will cause subsequent uncaughtExceptions to be missed. Seeing if there's a way round that... If I just swap "once" with "on" then this listener will just keep capturing the same exception again and again

grawk commented 9 years ago

Further, this brings up the question of what if there is another listener on uncaughtException that throws the exception after processing? Could it develop a feedback loop?

grawk commented 9 years ago

One thought would be to add an event handler mechanism to the nemo namespace itself, and at anywhere in the flow lifecycle, you could add a handler to it: nemo.on('uncaughtException', Promise);

And once all Promises are resolved on the exception, nemo logs the exception but doesn't throw it... Or by some other mechanism makes sure the final throw doesn't immediately trigger the event handlers again.

grawk commented 9 years ago

I went back to using flow.on to attach the exception handler. To make sure the exception isn't handled more than once by the handler, before throwing the exception i attach a property to it exception._nemoScreenshotHandled

This would work as long as others follow a similar convention.

grawk commented 9 years ago

execu-merge