Skip to content

fix: cross-platform integration test failures for macOS and Firefox - #427

Merged
BenjaminMichaelis merged 1 commit into
bmichaelis/MatrixIntegrationTestsfrom
copilot/fix-integration-tests
Aug 12, 2026
Merged

fix: cross-platform integration test failures for macOS and Firefox#427
BenjaminMichaelis merged 1 commit into
bmichaelis/MatrixIntegrationTestsfrom
copilot/fix-integration-tests

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown

Three distinct root causes were breaking matrix integration tests on macOS (both browsers) and Firefox (ubuntu + windows).

macOS — all code-execution tests fail

ClearMonacoEditor used Control+A, which on macOS is Monaco's Emacs "move to line start" binding, not "Select All". The editor was never cleared; old code remained; combined source failed to compile; every execution test returned RunCompleted: "Failed".

// Before
await editor.PressAsync("Control+a");
// After — Playwright sends Cmd+A on macOS, Ctrl+A elsewhere
await editor.PressAsync("ControlOrMeta+a");

Firefox — WaitForLoadStateAsync(NetworkIdle) timeouts

Playwright's 30 s default navigation timeout isn't enough for Firefox loading the Blazor WASM runtime. Raises it to 90 s in NewPageAsync().

page.SetDefaultNavigationTimeout(90_000f);

Windows/Firefox — diagnostics test captures empty setMarkers call

Monaco fires setMarkers([]) to clear previous markers before firing setMarkers([{error}]) with actual diagnostics. The predicate was resolving on the empty call; the 1 s settle delay was too short for real markers to arrive.

// Skip the empty clear-call; wait for actual diagnostic data
Predicate = message => message.Text.Contains("[MonacoEditorAdapter.setMarkers]")
                    && !message.Text.Contains(": []"),

Settle delay also increased from 1 s → 3 s.

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

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses cross-platform Playwright integration test flakiness/failures by making editor interactions and diagnostic waits more resilient across macOS and Firefox.

Changes:

  • Update Monaco editor clearing to use ControlOrMeta+a so “Select All” works on macOS and non-macOS platforms.
  • Increase Playwright navigation timeout to reduce Firefox load-state timeouts while Blazor WASM finishes loading.
  • Make the diagnostics console-message wait ignore the initial setMarkers([]) clear call and increase the settle delay.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Microsoft.TryDotNet.IntegrationTests/PlaywrightTestBase.cs Sets a longer default navigation timeout for pages created by the integration tests.
src/Microsoft.TryDotNet.IntegrationTests/PageExtensions.cs Fixes cross-platform Monaco editor clearing by using ControlOrMeta shortcuts.
src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs Improves diagnostic marker waiting by filtering out empty setMarkers([]) and increasing the post-log wait window.
Suppressed comments (1)

src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs:355

  • Using a fixed Task.Delay plus IsVisibleAsync() (without checking the returned bool) doesn’t reliably wait for the squiggly marker to render before the screenshot, and won’t fail if it never becomes visible. Prefer waiting on the selector becoming visible (which throws on timeout) instead of a hard sleep.
        await Task.Delay(TimeSpan.FromSeconds(3));

        var diagnosticMarker = page.Locator("div .squiggly-error");
        await diagnosticMarker.IsVisibleAsync();
        await page.TestScreenShotAsync();

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 34 to +38
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;
@BenjaminMichaelis
BenjaminMichaelis merged commit e41fc7a into bmichaelis/MatrixIntegrationTests Aug 12, 2026
12 of 13 checks passed
@BenjaminMichaelis
BenjaminMichaelis deleted the copilot/fix-integration-tests branch August 12, 2026 18:11
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.

3 participants