electron-userland / spectron

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

How to set up and run test in Angular? #233

Open ghost opened 6 years ago

ghost commented 6 years ago

I have a project using Angular and Electron, now I want to set up spectron for a testing so can I set up spectron with Karma or Protractor? If setting up spectron either with Karma or with Protractor doesn't work, then what should I do to apply spectron for Angular and Electron to my project? Thanks in advance?

wkoncki commented 6 years ago

I think you are missing the point slightly. Spectron is an end to end testing tool like Protractor. Unlike Protractor which is designed for webpages, Spectron is designed for Electron applications. You don't setup Spectron with Protractor, you use Spectron instead of Protractor.

When it comes to running unit tests with Karma you can start with looking at this https://github.com/colinskow/angular-electron-dream-starter This starter has Karma and Jasmine set up by default. You can check how they did it and copy it for your project, doing adjustments where necessary.

Hope this helps