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()