How can I test that my electron application was launched?


#1

I have an electron application that is capable of handling URLs with a custom scheme (e.g. myscheme://go/here). As such, when a user follows a link to a destination using my custom scheme, my electron application should launch, and the app should then handle the routing for the URL internally.

I have the first part working (launching the app from a custom URL, however I would like to cover this with a Spectron test. (Given MyApp is installed, When the user follows a custom scheme URL, Then the application is launched and XYZ view is shown). All of the Spectron examples I’ve seen rely on the test starting the app, whereas I want to test that the app was started by an external trigger.