-
Notifications
You must be signed in to change notification settings - Fork 407
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
Update spectron app handler to pick VSCode window #744
Conversation
const title = await this.webclient.getTitle(); | ||
|
||
if ( | ||
process.platform === 'win32' && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NodeJs always returns win32
regardless of which windows version is being used (https://nodejs.org/docs/latest-v8.x/api/process.html#process_process_platform).
if ( | ||
process.platform === 'win32' && | ||
title !== '' && | ||
/Visual Studio Code/.test(title) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do without this check but wanted to make sure we look for the vscode window in case the empty terminals start returning a title (currently they return an empty title).
Codecov Report
@@ Coverage Diff @@
## develop #744 +/- ##
========================================
Coverage 74.23% 74.23%
========================================
Files 163 163
Lines 6609 6609
Branches 1039 1039
========================================
Hits 4906 4906
Misses 1433 1433
Partials 270 270 Continue to review full report at Codecov.
|
for (let i = 0; i < count; i++) { | ||
await this.webclient.windowByIndex(i); | ||
|
||
if (/bootstrap\/index\.html/.test(await this.webclient.getUrl())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a basic question, but why is the window that we want in focus during the Spectron test going to be named "...bootstrap/index.html"? Is that a Spectron convention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That has to do with how spectron loads the vscode window, it's normally a file path that represents the local vscode location being used.
I think the path might've changed with vscode moving to a newer electron version (now we get something like electron-browser/workbench/workbench.html
) but I was only able to test in Windows and Mac OS so I kept this for now.
eb7617c
to
14f7ecb
Compare
What does this PR do?
Updates our Spectron application handler and re-enables system tests in appveyor. The changes address a Spectron Windows OS issue (electron-userland/spectron#60) where multiple empty terminals get opened when running Spectron, causing our tests to fail in appveyor.
What issues does this PR fix or reference?
@W-5511648@