-
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
Empty terminals display on Windows #60
Comments
Are you able to share the app you are testing with? |
Yes. I want to integrate it into my boilerplate. Here is work in progress: https://github.com/szwacz/electron-boilerplate/tree/e2e
|
I was able to replicate the empty terminals, not sure why this occurring, ChromeDriver spawns those windows so I'm not sure if it could be a regression there. I tried looking in their issue tracker and also tried a few tweaks to how ChromeDriver is spawned but no luck. You should still be able to get your tests passing though. On my Windows 10 VM, if I set the timeout to 10 seconds then they consistently pass without any other changes. this.timeout(10000); |
I have the same problem.. Spawning new windows makes it hard to write test for browserWindow.isFocused |
I have the same issue, I am also on Windows 10 and as @fantasticsid mentioned one of the empty terminal windows has focus, so you need to add a
at the beginning of your tests. On installing spectron repo and running the tests it is only those that test for focus that are failing out of the box. |
Same here. Spectron test for number of windows: |
I have the same problem with my Window 10 64 bit machine. I am using Spectron 3.6.2 and Electron 1.6.7. Since the change log does not mention any changes regarding this issue I assume that a newer version will not fix this? |
I have the same issue. Any update? |
Is anyone working on getting this fixed ? Right now the only workaround i found is :
|
Happening to me as well. Opening my app spawns 8 (!) empty terminal windows. They have the same title than the "good" one, so it's not easy to identify and switch to it. |
I'm having the same issue. I'm running on Windows 10 and I am literally just using the first example off the Spectron readme. I published my code up to github here: https://github.com/evanlarsen/IssueWithSpectronSpawningMultipleTerminals |
Having the same issue, has anyone found a workaround for this? |
Having same problem/issue, did anyone has solution to suppress the empty windows ? |
I am also having the 2 terminal windows appearing issue. browserWindow.focus didn't work for me, I had to do a browserWindow.setAlwaysOnTop(true). It's very annoying. Does anyone have any idea what's going on ? is it a ChromeDriver issue? |
@chrisgeorge0911 How exactly was |
I have the same issue and for me the promise returned by |
Same here... is someone working on it? |
1 similar comment
Same here... is someone working on it? |
I'm able to reproduce this with these bare minimal steps:
This launches the main Electron app (with default screen), and also 2 of the empty console windows! |
I'm able to workaround this issue by manually focusing the window:
This has to be run every time a window is opened, since each new window brings up 2 new consoles. |
When we set Any workarounds for this? Is it usual behaviour on mac as well? |
https://stackoverflow.com/questions/51972307/spectron-opens-empty-terminals-during-test-run I had tested the same electron application using selenium with the help of chrome capabilities that point to the electron exe instead of chrome binary. https://stackoverflow.com/a/51186740/8903949 I don't see these empty terminals there. |
For example: |
@AdamMauger I looked on your function I think a combination of focus() with alwaysOnTop(true). Solved. at least for me. I'm using Mocha with chai as promised.
beforeEach(function() {
app = new Application({
path: electronPath,
env: {
ELECTRON_ENV: 'test'
},
startTimeout: 10000,
waitTimeout: 10000,
args: [path.join(__dirname, '..')]
});
chaiAsPromised.transferPromiseness = app.transferPromiseness;
return app.start().then( async () => {
await app.browserWindow.focus();
await app.browserWindow.setAlwaysOnTop(true);
});
}); |
Just back-referencing why it's opening empty windows.
|
I tried installing v3.7.1 - the latest release before the change of launcher to
Update: It seems I can only run this with Electron 2.0.18 and Spectron 3.7.1, every other combination I've tried results in a hopelessly broken thing |
Our project ran into this issue when running ava tests using spectron and since we have it set up to run multiple electron apps in parallel this would flood the machine with like 4-8 popup Electron console windows while running the tests. I managed to make a change that fixed it in our case. I noticed that it was happening because of the --enable-logging parameter being passed in. So I made a modified version of launcher.js which purposely didn't include --enable-logging and it worked fine for us:
I couldn't find where the spectron launcher was managing to pick up the --enable-logging flag from as I thought a better solution would have been just not providing it to launcher.js in the first place but I couldn't find out so I just went with the solution that worked for now. My assumption was that the --enable-logging flag was being picked up somewhere inside of webdriverio when the client is initialized and thus calls launcher.bat but I couldn't find out where. |
@senyszrm - This worked! Thank you so much. I had to splice it off after it // launcher.js
. . .
var args = appArgs.concat(chromeArgs)
// add this line
args.splice(args.indexOf('--enable-logging'), 1) Spectron version: 10.0.1 |
Same problem for me. |
any updates? electron@7 and spectron@9 |
same here |
same here Electron 8.5.5 and Spectron 10.0.1 |
I had the similar issues on Windows and wanted to let you know a couple solutions I found. I'm using Electron 8.5.3 and Spectron 10.0.1 along with jest 24.9.0. Everything worked well on MacOS , but when I tried to run my tests with jest, I would have tons of electron process terminals open up (like 6 per test), along with my app, then all my tests would fail. One thing a co-worker noticed is that with our jest we actually had "@jest-runner/electron" as our default runner. This was opening the electron process and, in trying to run that with spectron, I was essentially creating all these electron processes that weren't necessary. we went ahead and changed this by creating a seperate config file including :
and then in our package.json referenced this config file
Introducing this had the tests passing immediately. We still had a couple open electron processes in the background, but i went ahead used the |
@ginnyyadav couldn't reproduce the fix with [email protected], [email protected], [email protected] on Windows Tried with both jest-runner and @jest-runner/electron, the @jest-runner/electronw wouldn't even start. Update: Re-testing with your exact same library versions also doesn't work. |
@Wensh you'll definitely want to use the default jest-runner. Would it help to see my project? We are an open source company so feel free to peruse. https://github.com/tidepool-org/uploader/tree/integrate-spectron/test/spectron this is my branch where I am integrating spectron. I've sent you the direct link to the spectron folder where all the spectron stuff lives. Edit: Just so you know I am using page objects, so it may look a bit different than the typical spectron setup. |
@ginnyyadav Thanks for your help, I checked your project, but it was too dissimilar with mine (TypeScript, Electron-webpack etc). For now I am using the solution from @wburgess-invision |
it looks like electron problem, i used electron only and had the same issue, the solution in this link works for me, by removing |
Running 'getting started' script from http://electron.atom.io/spectron/
This is the result:
First window is the application as I wanted it to be (but tests don't pass), other windows look like terminals without anything inside. Anyone seen something similar?
I'm using Windows 10 via VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/mac/
The text was updated successfully, but these errors were encountered: