spectron icon indicating copy to clipboard operation
spectron copied to clipboard

Error: Timeout of 10000ms exceeded.

Open kunlk opened this issue 3 years ago • 3 comments

Hi Team,

I am trying to run the scripts which refer the readme by slightly modified:

const assert = require('assert');
const path = require('path');
const Application = require('spectron').Application;

describe('Application launch', function () {
    this.timeout(10000)

    beforeEach(function () {
        this.app = new Application({
            path: '/home/ubuntu/jitsi/jitsi-meet-electron-master/dist/jitsi-meet-x86_64.AppImage',
            args: ['--no-sandbox']
        })
        return this.app.start()
    })

    afterEach(function () {
        if (this.app && this.app.isRunning()) {
            return this.app.stop()
        }
    })

    it('shows an initial window', function () {
        return this.app.client.getWindowCount().then(function (count) {
            assert.equal(count, 1)
        })
    })
})

I got the error as below:

root@test:/home/ubuntu/jitsi/jitsi-meet-electron-master# npm test

> [email protected] test /home/ubuntu/jitsi/jitsi-meet-electron-master
> mocha



  Application launch
    1) "before each" hook for "shows an initial window"


  0 passing (10s)
  1 failing

  1) Application launch
       "before each" hook for "shows an initial window":
     Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/ubuntu/jitsi/jitsi-meet-electron-master/test/spec.js)
      at listOnTimeout (internal/timers.js:554:17)
      at processTimers (internal/timers.js:497:7)



npm ERR! Test failed.  See above for more details.

I'm on Ubuntu 18.04 with

kunlk avatar Nov 10 '20 12:11 kunlk

I am encountering the same problem, but on macOS.

evgenykochetkov avatar Nov 29 '20 08:11 evgenykochetkov

I have the same problem. Solved it on MacOS with:

this.app = new Application({
    path: electronPath,
    args: ['.'],
    startTimeout: 10000,
    waitTimeout: 10000,
    chromeDriverLogPath: '../chromedriverlog.txt',
    chromeDriverArgs: ['remote-debugging-port=9222'],
  });
return this.app.start();

But have not been able to find a solution for windows

acstacey avatar Dec 18 '20 00:12 acstacey

google is your friend. search: For async tests and hooks, ensure "done()" is called

Tester-Dolores avatar Jun 02 '21 07:06 Tester-Dolores