Skip to content
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

Make executeWorkbench work after VSCode restarts #106

Merged

Conversation

ilia-db
Copy link
Contributor

@ilia-db ilia-db commented Feb 15, 2024

vscode.openFolder can be used to restart the VSCode under different workspace root. In that case the current socket is closed, and then the new connection appears after the VSCode is up again.

This PR clears pending message callbacks when the connection is closed and re-assigns the _promisedSocket to a new socket when new connection appears.

Fixes #62

Had to hard-code vscode version to 1.85.2 when running tests locally, since newer chromedriver versions live in a new location. Seems like there's a PR already to fix it #105

`vscode.openFolder` can be used to restart the VSCode under different
workspace root. In that case the current socket is closed, and then the new
connection appears after the VSCode is up again.

This PR clears pending message callbacks when the connection is closed, and also
re-assigns the `_promisedSocket` to a new socket when new connection appears.
Copy link
Contributor

@seanpoulter seanpoulter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

test/specs/workbench.e2e.ts Outdated Show resolved Hide resolved
Co-authored-by: Sean Poulter <sean.poulter+gh@gmail.com>
Copy link
Contributor

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Thanks a lot!

Copy link
Contributor

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! It seems like the added test fails in our pipeline, mind taking a look?

Co-authored-by: Sean Poulter <sean.poulter+gh@gmail.com>
Copy link
Contributor

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's :shipit:

Thanks!

@christian-bromann christian-bromann merged commit 45de785 into webdriverio-community:main Feb 15, 2024
9 checks passed
@wdio-bot
Copy link
Collaborator

Hey ilia-db 👋

Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at expense@webdriver.io or in the contributing channel on Discord.

We are looking forward to more contributions from you in the future 🙌

Have a nice day,
The WebdriverIO Team 🤖

@christian-bromann
Copy link
Contributor

Released as part of v6.0.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

executeWorkbench() doesn't work after Open Folder is called
4 participants