Electron Protractor End-to-End Testing

I am currently working on an Electron application, and now I want to integrate end-to-end testing with Protractor . I looked through the tutorials for Protractor, and now I'm trying to adapt it to Electron. Since Electron works as a standalone application, how do I do this?

It seems that Protractor picks up a Selenium server, which then tries to contact an available HTTP server and run tests like click here, which url I am on, enter this text, etc.

So, how can I let the selenium server access the electron instance?

In any case, that my thinking about the situation, any help is welcome and do not hesitate to correct any of my assumptions.

+6
source share
2 answers

Adapting the instructions described in Using Selenium and WebDriver , here's what you need to put in your transporter's configuration (using directConnect as an example):

 exports.config = { directConnect: true, capabilities: { browserName: "chrome", chromeOptions: { binary: '/Path-to-Your-App.app/Contents/MacOS/Atom' // < IMPORTANT! }, }, // ... } 

(not verified)

+4
source

Alecx's answer is mostly correct, but there is a slight inaccuracy with it.

The binary should be attached to chromeOptions as follows:

 exports.config = { directConnect: true, capabilities: { browserName: "chrome", chromeOptions: { binary: '/Path-to-Your-App.app/Contents/MacOS/Atom' // < IMPORTANT! } }, // ... } 
+3
source

All Articles