electron-userland / spectron

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

Failing tests on travis(linux) #158

Closed akashnimare closed 7 years ago

akashnimare commented 7 years ago

It works perfectly on macOs. Here is the log- https://travis-ci.org/zulip/zulip-electron/jobs/189770648

But for some reason it fails on linux. Logs - https://travis-ci.org/zulip/zulip-electron/jobs/189770553

test.js

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

describe('application launch', function () {
  this.timeout(15000)

  beforeEach(function () {
    this.app = new Application({
      path: require('electron'),
      args: [__dirname + '/../app/main/index.js']
    })
    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)
    })
  })
})

Here is app I'm working on - zulip-electron

@kevinsawicki could you please tell me what I'm doing wrong?

MarshallOfSound commented 7 years ago

@akashnimare You should log out the URL's of the windows that the webdriver is identifying. You are probably launching either a webview or a dev tools extension background page.

akashnimare commented 7 years ago

You should log out the URL's of the windows that the webdriver is identifying.

@MarshallOfSound I'm not sure if this is the problem. Btw everything works perfectly if I test it locally on Ubuntu 14.04 but on travis it keeps failing :(

akashnimare commented 7 years ago

@MarshallOfSound I just tested it against a static file (index.html) and it's not failing. I think you're right. The actual cause of this problem is the webview.

akashnimare commented 7 years ago

I still don't know why loading a webview works perfectly in OSX both locally and on travis.