electron-userland / spectron

DEPRECATED: 🔎 Test Electron apps using ChromeDriver
http://electronjs.org/spectron
MIT License
1.68k stars 229 forks source link

Handling error alert windows #133

Closed taboca closed 7 years ago

taboca commented 7 years ago

I have noticed that under certain conditions I saw a javascript alert error message that was displayed from the electron app context.

I wanted to open this bug to attempt to collect, and understand, all the cases which Electron app launches popups, and then to see how spectron could deal with monitoring or handling these content interactions.

kevinsawicki commented 7 years ago

Spectron can't currently communicate with Electron dialogs via the ChromeDriver/webdriverio libraries, #23.

Electron only displays error alerts for uncaught exceptions when the default app is used.

Registering a process.on('uncaughtException', function() {}) handler in both processes should prevent it from opening any.

https://github.com/electron/electron/blob/d0643250f717a9e5d9d4869f72fd5437c88e862f/lib/browser/init.js#L46-L58