-
-
Notifications
You must be signed in to change notification settings - Fork 742
Collection of test fixes #962
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
base: develop
Are you sure you want to change the base?
Conversation
Negative values for cursor position are not invalid
Because we need a visible window and the main window visibility must not be mutated by tests
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.
Pull request overview
This PR contains a collection of test fixes addressing flaky tests and improving test reliability. The changes include timeout adjustments, test refactoring to use isolated browser windows with proper cleanup, removal of platform-specific CI skips to re-enable tests, and simplification of some test assertions.
Key changes:
- Refactored several tests to create and destroy dedicated browser windows instead of reusing the main window, ensuring test isolation
- Increased printer enumeration timeout from 5 to 8 seconds to prevent timeout failures
- Removed coordinate assertions in cursor position tests that could fail in multi-monitor configurations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| WebContentsTests.cs | Added ElectronNET.API using directive; refactored GetSetZoomLevel_check and Show_hide_visibility_roundtrip to use isolated windows with cleanup; commented out CI-specific test skips; simplified DevTools and UserAgent tests |
| ScreenTests.cs | Removed coordinate >= 0 assertions from GetCursorScreenPoint test to handle multi-monitor setups |
| BrowserWindowTests.cs | Removed unused System.Runtime.InteropServices import; refactored Show_hide_visibility_roundtrip and ReadyToShow tests to use isolated windows with proper cleanup |
| WebContents.cs | Increased GetPrintersAsync timeout from 5000ms to 8000ms to prevent timeout failures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Re-enable some tests for CI as experiment
b6ba78c to
88d2daa
Compare
| /// </summary> | ||
| /// <returns></returns> | ||
| public Task<string> GetUserAgentAsync() => InvokeAsync<string>(); | ||
| public Task<string> GetUserAgentAsync() => InvokeAsyncWithTimeout<string>(3000); |
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.
Should we always use the underscore as a separator for digits > 1000 (1_000, 1_000_000, ...). To be consistent also with line 176. I'd actually prefer that (consistency + readability).
|
|
||
| // Typical usage is to show once ready | ||
| window.Show(); | ||
| var completed = await Task.WhenAny(tcs.Task, Task.Delay(3000)); |
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.
3_000 ?
| } | ||
| } | ||
|
|
||
| [Fact(Timeout = 20000)] |
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.
Not sure if we should just apply this refactoring / readability improvement to the whole codebase to have also the existing ones (20000 -> 20_000) updated. Thoughts?
FlorianRappl
left a comment
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.
LGTM!
No description provided.