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

fix: Prevent "Connection closed" errors when deleting the session for @wdio/cucumber-framework #116

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

seanpoulter
Copy link
Contributor

Proposed Changes

This fixes #115.

Validation

Since we don't have Cucumber set up in this repo I used seanpoulter/wdio-vscode-cucumber-example:

$ cd .../wdio-vscode-service
$ npm link
$ npm run build

$ cd .../wdio-vscode-cucumber-example
$ npm link wdio-vscode-service

$ npm run test


> test
> wdio run ./test/wdio.conf.ts


Execution of 1 workers started at 2024-02-27T01:45:04.115Z

Skipping download, bundle for ChromeDriver v27.2.3 already exists
Found existing install in .../.wdio-vscode-service/vscode-linux-arm64-1.86.2. Skipping download
[0-0] RUNNING in chrome - file:///test/features/webview.feature
[0-0] PASSED in chrome - file:///test/features/webview.feature

 "spec" Reporter:
------------------------------------------------------------------
[chrome 118.0.5993.159 linux #0-0] Running: chrome (v118.0.5993.159) on linux
[chrome 118.0.5993.159 linux #0-0] Session ID: 90871adafb5727ca052e30dc884ec9e9
[chrome 118.0.5993.159 linux #0-0]
[chrome 118.0.5993.159 linux #0-0] » /test/features/webview.feature
[chrome 118.0.5993.159 linux #0-0] Hello World
[chrome 118.0.5993.159 linux #0-0] As an extension developer
[chrome 118.0.5993.159 linux #0-0] I want to test if a Webview is displayed
[chrome 118.0.5993.159 linux #0-0]
[chrome 118.0.5993.159 linux #0-0] Webview Shows "Hello World!"
[chrome 118.0.5993.159 linux #0-0]    ✓ When I open the Webview
[chrome 118.0.5993.159 linux #0-0]    ✓ Then I expect that "Hello World!" is displayed
[chrome 118.0.5993.159 linux #0-0]
[chrome 118.0.5993.159 linux #0-0] 2 passing (3.2s)


Spec Files:      1 passed, 1 total (100% completed) in 00:00:10  

🎉

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.

I am a bit confused as to why Cucumber behaves differently here. Added some comments to make this change a bit more clear to contributors in the future.

src/service.ts Outdated Show resolved Hide resolved
src/service.ts Show resolved Hide resolved
Co-authored-by: Christian Bromann <[email protected]>
@seanpoulter
Copy link
Contributor Author

I am a bit confused as to why Cucumber behaves differently here.

Me too. There wasn't anything obvious comparing the run method for the Mocha and Cucumber frameworks. As a hunch, it seems like Mocha is either not making request after the test case, or it's hiding the rejected promise.

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 :shipit:

@seanpoulter seanpoulter merged commit efb6b1b into webdriverio-community:main Feb 27, 2024
7 of 9 checks passed
@wdio-bot
Copy link
Collaborator

Hey seanpoulter 👋

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 [email protected] 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 🤖

@seanpoulter seanpoulter deleted the issue-115 branch March 22, 2024 17:24
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.

Unexpected "Connection closed" when runing with @wdio/cucumber-framework
3 participants