utils.js 445 B

123456789101112131415161718192021222324
  1. import electron from 'electron'
  2. import { Application } from 'spectron'
  3. export default {
  4. afterEach () {
  5. this.timeout(10000)
  6. if (this.app && this.app.isRunning()) {
  7. return this.app.stop()
  8. }
  9. },
  10. beforeEach () {
  11. this.timeout(10000)
  12. this.app = new Application({
  13. path: electron,
  14. args: ['dist/electron/main.js'],
  15. startTimeout: 10000,
  16. waitTimeout: 10000
  17. })
  18. return this.app.start()
  19. }
  20. }