From 259c8c64befc1832a7dbfd36c80b5bad6e9f1cd5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 12 Aug 2026 17:49:28 +0000 Subject: [PATCH] fix: cross-platform integration test failures for Firefox and macOS - ClearMonacoEditor: use ControlOrMeta+a instead of Control+a so that Select All works on macOS (where Ctrl+A moves cursor instead of selecting) - PlaywrightTestBase.NewPageAsync: raise default navigation timeout to 90 s to give Firefox time to reach NetworkIdle while loading Blazor WASM - EditorTests diagnostics test: filter out the empty setMarkers([]) call that Monaco fires before actual diagnostic markers arrive, and extend the post-receive settle delay from 1 s to 3 s Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com> --- src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs | 6 ++++-- src/Microsoft.TryDotNet.IntegrationTests/PageExtensions.cs | 3 ++- .../PlaywrightTestBase.cs | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs b/src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs index 68ad4f676..299f673a7 100644 --- a/src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs +++ b/src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs @@ -342,11 +342,13 @@ await editor.PressSequentiallyAsync(@"///////////////////////// }, new PageRunAndWaitForConsoleMessageOptions() { - Predicate = message => message.Text.Contains("[MonacoEditorAdapter.setMarkers]"), + // Skip the initial empty setMarkers([]) call that Monaco fires to clear previous + // markers; wait for a non-empty call that actually contains diagnostic data. + Predicate = message => message.Text.Contains("[MonacoEditorAdapter.setMarkers]") && !message.Text.Contains(": []"), Timeout = Debugger.IsAttached ? 0.0f : (float)TimeSpan.FromMinutes(10).TotalMilliseconds }); - await Task.Delay(TimeSpan.FromSeconds(1)); + await Task.Delay(TimeSpan.FromSeconds(3)); var diagnosticMarker = page.Locator("div .squiggly-error"); await diagnosticMarker.IsVisibleAsync(); diff --git a/src/Microsoft.TryDotNet.IntegrationTests/PageExtensions.cs b/src/Microsoft.TryDotNet.IntegrationTests/PageExtensions.cs index 8f9c3fbc2..46a04e597 100644 --- a/src/Microsoft.TryDotNet.IntegrationTests/PageExtensions.cs +++ b/src/Microsoft.TryDotNet.IntegrationTests/PageExtensions.cs @@ -96,7 +96,8 @@ public static async Task ClearMonacoEditor(this IPage page) var editor = page.Locator(@"textarea[role = ""textbox""]"); await editor.IsVisibleAsync(); await editor.FocusAsync(); - await editor.PressAsync("Control+a"); + // Use ControlOrMeta+a so the shortcut works on both macOS (Cmd+A) and other platforms (Ctrl+A). + await editor.PressAsync("ControlOrMeta+a"); await editor.PressAsync("Delete"); } diff --git a/src/Microsoft.TryDotNet.IntegrationTests/PlaywrightTestBase.cs b/src/Microsoft.TryDotNet.IntegrationTests/PlaywrightTestBase.cs index 0bddf5878..f295c9909 100644 --- a/src/Microsoft.TryDotNet.IntegrationTests/PlaywrightTestBase.cs +++ b/src/Microsoft.TryDotNet.IntegrationTests/PlaywrightTestBase.cs @@ -32,7 +32,10 @@ protected PlaywrightTestBase( protected async Task NewPageAsync() { var playwright = await Services.GetPlaywrightAsync(); - return await playwright.Browser.NewPageAsync(); + var page = await playwright.Browser.NewPageAsync(); + // Firefox needs more time to reach NetworkIdle due to Blazor WASM loading. + page.SetDefaultNavigationTimeout(90_000f); + return page; } protected async Task TryDotNetUrlAsync()