-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application.InitalizeClient fails to complete #219
Comments
let me tell you which part you did mistake, the Spectron's new Application option takes the path to your application. so it's should be
and i have another helper function which is
and my helper test cases are looklike this,
btw i'm using Ava test framework which is really developer friendly due of this setup should work if you face feature problem let me know. |
@Flaque I'm experiencing the same when running Spectron in Travis. I have problems debugging it though, because it only appears in Travis. Did you find any solution for this? node version: 7.7.4 |
Now I've managed to reproduce this error on my Mac. It seems like electron-chromedriver won't start when I pass in the chromeDriverLogPath option. When I try to run electron-chromedriver with cli I get
It appears that should've read the docs and specified a path to a file for the chromeDriverLogPath. It would be great if spectron could throw an error if the chrome driver fails to start. chromedriver exists with code 0, which makes it hard to determine. Anyway, my error still appears in Travis. Even though it was fixed locally. When I check the webdriver log from Travis I see the following:
It looks like the chromedriver won't start even there. Edit: Solution: I forked spectron and printed all the stdout from chromedriver to console. There I found out that my application threw an error upon start, once that was solved everything works as expected. Ie there was no problem with starting chromedriver. |
Hi, Running on windows 7, electron 1.7.6 spectron 3.7.2 Any help would be appreciated! |
Same here, stuck in the client.init call. The app is starting multiple times, even after the callback times out. Additionally, logging seems to be enabled only when I configure webDriverLogPath. |
Seeing the same problem on Circle CI only (Works locally and on Travis CI). @kontrollanten Any hint on how to do this: |
@ericyahhh As far as I remember I only did this change; https://github.com/kontrollanten/spectron/commit/2be2b56454bdd9dc5b345853794021e59ca8f7f1 |
@kontrollanten Thank you very much – I'll try that out now. |
Ran into this problem last week and spent the last few days trying to figure it out. Symptoms were the same: the app would halt at WebdriverIO.init, except I was only seeing this failure on Windows and not on Mac. The only thing that fixed it for me was changing the
Things I tried that had no effect:
Hope that someone finds this useful. |
I stumbled across this issue in my search for a solution to a similar problem. I'm unclear if other people on this issue were having their Electron app start up or not, but I was so none of the suggestions seemed applicable as Spectron clearly had the right Electron path and the app was not throwing an error during boot. I eventually tracked the problem down to this issue in the Electron repository. All I needed to fix it was to pass the Hope this saves someone else the day I lost hunting this down 😬 |
What I'm trying to do
I'm trying to run a basic test with Jest. I have two basic helpers that make the electron path and make the application:
Then, I have a really simple test that opens up the electron app then counts how many windows there are:
The Problem
When I try to run this, I'll get an error that says that the promise on
app.start()
in thebeforeEach()
call failed to complete:What I've tried so far.
1. Logging
Application.prototype.start()
Inside my
node_modules/spectron/lib/application.js
file, I put a fewconsole.log
's in theApplication.prototype.start
call like so:That printed out only:
So I know that it's never getting to the
self.api.initialize()
call. Which means the problem is increateClient
2. Checking
createClient
Since
createClient
doesn't seem to have any promise calls until the end, I figured most of that must be executing. So to prove that, I put aconsole.log
in the start ofinitializeClient
to prove that we were at least getting there:Sure enough, I'll get a message that says
initializeClient gets called
.3. Checking
initializeClient
Inside of
initializeClient
there's aninit
function that calls WebdriverIO'sclient.init
function:To see where this was going, I checked to see if the function was being called and if it errorred:
I got a
Starting an init function
but noThere is an error in init!!
so I can assume thatclient.init
got stuck somewhere.4. Getting lost in WebdriverIO
So I went to go read webdriver's
client.init
code and I got a little lost here. It seems like/session
call must have gotten lost somewhere.But if it had some error, wouldn't it log it or throw it somehow? Isn't this supposed to be running locally too? So there shouldn't be latency. I'm not completely sure what's up.
Main Questions
Has anyone ever experienced anything like this? Does it have something to do with running on Jest? Have I made some simple mistake early on?
The text was updated successfully, but these errors were encountered: