electron-userland / spectron

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

OS X run .app with Spectron #276

Open just-jeb opened 6 years ago

just-jeb commented 6 years ago

I'm trying to test the application after it's been packaged with electron-builder.
Unpacking dmg on OS X results in .app package which cannot be run by Spectron (as it is not a file).
I've tried to copy this to /Applications directory and run it like this:

new SpectronApplication({
    path: '/usr/bin/open',
    args: ['-a MyApp']
  }); 

but still no success - Travis CI build fails with timeout message:

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself. Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

Any idea how do I test the packaged application(dmg) with Spectron?

P.S. I do know how to test it before packaging, but I need the tests run after the packaging.

timfish commented 6 years ago

I haven't tried this myself but I'm guessing you have to point at the executable inside the .app

new SpectronApplication({
    path: '/Applications/MyApp.app/Contents/MacOS/MyApp',
  });