Skip to content

Conversation

@softworkz
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings December 6, 2025 19:17
Copy link

Copilot AI left a 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
/// </summary>
/// <returns></returns>
public Task<string> GetUserAgentAsync() => InvokeAsync<string>();
public Task<string> GetUserAgentAsync() => InvokeAsyncWithTimeout<string>(3000);
Copy link
Collaborator

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));
Copy link
Collaborator

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)]
Copy link
Collaborator

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?

Copy link
Collaborator

@FlorianRappl FlorianRappl left a comment

Choose a reason for hiding this comment

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

LGTM!

@FlorianRappl FlorianRappl changed the title Colledtion of test fixes Collection of test fixes Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants