Skip to content

Fix dashboard Playwright tests after Fluent UI v5 migration - #20341

Merged
James Newton-King (JamesNK) merged 5 commits into
mainfrom
jamesnk/fluent-v5-native-aot-playwright-fixes
Sep 23, 2026
Merged

James Newton-King (JamesNK) merged 5 commits into
mainfrom
jamesnk/fluent-v5-native-aot-playwright-fixes

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Dashboard Playwright coverage regressed after the Fluent UI v5 migration because generated component structure and accessibility behavior changed, terminal and menu interactions retained stale browser state, and tests sharing a Dashboard fixture could overlap through Blazor circuit disposal.

This change aligns the Dashboard and its browser tests with Fluent UI v5:

  • Updates selectors and accessibility expectations to target stable Dashboard-owned structure.
  • Keeps terminal sizing from stealing focus and verifies keyboard, read-only, resize, and dock behavior.
  • Makes cursor-positioned menus reopen reliably after Escape or light dismiss by ignoring stale Fluent close callbacks during a deliberate reopen.
  • Serializes tests that share a Dashboard fixture through browser-context disposal.
  • Uses adaptive Playwright action, navigation, assertion, and task timeouts: 5 seconds locally and 30 seconds in CI.
  • Replaces fixed graph settling delays with position-based readiness.
  • Removes Dashboard accessibility workarounds for Fluent controls; remaining Fluent accessibility gaps are tracked upstream.

User-facing usage

Resource graph context menus can be reopened immediately after Escape or light dismiss, and terminal auto-fit no longer moves focus away from the user's active control.

Screenshots / Recordings

This PR includes UI changes. Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally.

  • For before/after comparisons, place them side-by-side or label them clearly.
  • For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video).
  • If you cannot capture visuals now, note what scenario to test and mark this section as TODO.

TODO: Capture the resource graph context menu reopening after Escape and terminal dock keyboard/focus behavior. There is no intended visual redesign.

Validation

  • AspireMenu component tests: 11 passed.
  • Resources Playwright tests: 9 passed.
  • Terminal Playwright tests: 12 passed.
  • Terminal dock Playwright tests: 7 passed.
  • Mobile navigation Playwright tests: 2 passed.
  • Browser token Playwright tests: 5 passed; WebKit skipped because it is unavailable locally.
  • Accessibility delegated-focus Playwright tests: 6 passed.
  • git diff --check passes.

Upstream Fluent UI issues:

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20341

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20341"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Known Fluent v5 violations still break the WCAG suite, and browser-level terminal completion coverage was removed.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity · 1 Medium severity

Open (3)
What changed in this PR

Aligns Dashboard behavior and browser tests with Fluent UI v5.

Changes:

  • Updates Playwright selectors, accessibility checks, and adaptive timeouts.
  • Prevents terminal focus stealing and improves menu reopening.
  • Serializes fixture tests through browser-context disposal.
File Description
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​TerminalTests.cs Updates terminal selectors and assertions.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​TerminalDockTests.cs Updates focus expectations and removes completion coverage.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​ResourcesTests.cs Adapts resource graph interaction tests.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​NativeAotDashboardTests.cs Configures adaptive timeouts.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​MobileNavMenuTests.cs Uses configured browser contexts.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​Infrastructure/​PlaywrightTestsBase.cs Serializes tests and context disposal.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​Infrastructure/​PlaywrightFixture.cs Centralizes Playwright timeouts.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​Infrastructure/​DashboardServerFixture.cs Adds fixture gate and adjusts disposal order.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​DashboardInteractionsTests.cs Updates layout synchronization and geometry.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​BrowserTokenAuthenticationTests.cs Updates selectors and timeout handling.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​AspireMenuLayoutTests.cs Updates action-menu selector.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​AppBarTests.cs Updates Fluent v5 layout expectations.
tests/​Aspire.Dashboard.Tests/​Integration/​Playwright/​AccessibilityTests.cs Adapts accessibility probes and selectors.
tests/​Aspire.Dashboard.Components.Tests/​Pages/​ConsoleLogsTerminalTests.cs Verifies terminal dropdown placeholder.
tests/​Aspire.Dashboard.Components.Tests/​JavaScript/​TerminalView.test.mjs Verifies non-stealing terminal focus.
tests/​Aspire.Dashboard.Components.Tests/​Controls/​AspireMenuTests.cs Covers repeated cursor-menu opening.
src/​Aspire.Dashboard/​wwwroot/​css/​controls.css Adjusts menu positioning and sizing.
src/​Aspire.Dashboard/​Components/​Layout/​DesktopToolbarDivider.razor Updates divider semantics.
src/​Aspire.Dashboard/​Components/​Dialogs/​SettingsDialog.razor Adapts Fluent control accessibility attributes.
src/​Aspire.Dashboard/​Components/​Controls/​TerminalView.razor.js Stops auto-fit from requesting focus.
src/​Aspire.Dashboard/​Components/​Controls/​TerminalView.razor.cs Removes obsolete JavaScript label option.
src/​Aspire.Dashboard/​Components/​Controls/​TerminalView.razor Moves terminal dimensions text to placeholder.
src/​Aspire.Dashboard/​Components/​Controls/​ResourceActions.razor Updates divider semantics.
src/​Aspire.Dashboard/​Components/​Controls/​AspireMenuButton.razor Adds a positioned menu wrapper.
src/​Aspire.Dashboard/​Components/​Controls/​AspireMenu.razor.cs Handles stale close callbacks during reopen.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

14 / 99 PR test projects · 2 PR jobs, from 25 changed files.

Selected PR test projects (14 / 99)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests, Infrastructure.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 10 of the 14 selected test projects come from a single change — src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.cs.

🔧 src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.cs (changed source)
→ 10 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

🧪 tests/Aspire.Dashboard.Components.Tests/JavaScript/TerminalView.test.mjs (changed test)
→ 2 directly: Aspire.Dashboard.Components.Tests, Infrastructure.Tests

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🔧 src/Aspire.Dashboard/Components/Controls/TerminalView.razor.js (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Dashboard/wwwroot/css/controls.css (changed source)
→ 1 via the project graph: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/AspireMenuTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTerminalTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/AccessibilityTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/AppBarTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/AspireMenuLayoutTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/BrowserTokenAuthenticationTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/DashboardInteractionsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/Infrastructure/DashboardServerFixture.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/Infrastructure/PlaywrightFixture.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/Infrastructure/PlaywrightTestsBase.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/MobileNavMenuTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/NativeAotDashboardTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/ResourcesTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/TerminalDockTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/TerminalTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.cs, src/Aspire.Dashboard/Components/Controls/AspireMenuButton.razor, src/Aspire.Dashboard/Components/Controls/ResourceActions.razor, src/Aspire.Dashboard/Components/Controls/TerminalView.razor, src/Aspire.Dashboard/Components/Controls/TerminalView.razor.cs, src/Aspire.Dashboard/Components/Controls/TerminalView.razor.js, src/Aspire.Dashboard/Components/Dialogs/SettingsDialog.razor, src/Aspire.Dashboard/Components/Layout/DesktopToolbarDivider.razor, src/Aspire.Dashboard/wwwroot/css/controls.css
• affected project Aspire.Dashboard
native-dashboard-validation • tests/Aspire.Dashboard.Tests/Integration/Playwright/NativeAotDashboardTests.cs
• affected project Aspire.Dashboard

Selection computed for commit f4a99fc.

Comment thread src/Aspire.Dashboard/Components/Dialogs/SettingsDialog.razor
@JamesNK
James Newton-King (JamesNK) merged commit 0e7147e into main Sep 23, 2026
155 checks passed
@github-actions github-actions Bot added this to the 13.6 milestone Sep 23, 2026
Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Sep 24, 2026
Backports #20360, #20341, and #20362 to release/13.6.

## Customer Impact

Dashboard users can encounter popups that are misaligned, overflow the
viewport, or disappear while metric dimensions update. Resource graph
context menus may not reopen immediately after dismissal, and terminal
auto-fit can move focus away from the active control.

## Testing

Validated on the release/13.6 backport branch: 570
Aspire.Dashboard.Components.Tests and 1,892 Aspire.Dashboard.Tests
passed, excluding quarantined and outerloop tests. The source changes
also include targeted Playwright coverage for resources, terminal,
navigation, authentication, accessibility, and popup behavior. `git diff
--check` passes.

## Risk

Medium. The production changes are localized to Dashboard popup, focus,
and component-state behavior with no public API changes, but this
combines three related changes and a broad component-test migration.

## Regression?

Yes — fixes Dashboard behavior and test regressions introduced by the
Fluent UI v5 migration.
David Pine (IEvangelist) pushed a commit that referenced this pull request Oct 1, 2026
Backports #20360, #20341, and #20362 to release/13.6.

## Customer Impact

Dashboard users can encounter popups that are misaligned, overflow the
viewport, or disappear while metric dimensions update. Resource graph
context menus may not reopen immediately after dismissal, and terminal
auto-fit can move focus away from the active control.

## Testing

Validated on the release/13.6 backport branch: 570
Aspire.Dashboard.Components.Tests and 1,892 Aspire.Dashboard.Tests
passed, excluding quarantined and outerloop tests. The source changes
also include targeted Playwright coverage for resources, terminal,
navigation, authentication, accessibility, and popup behavior. `git diff
--check` passes.

## Risk

Medium. The production changes are localized to Dashboard popup, focus,
and component-state behavior with no public API changes, but this
combines three related changes and a broad component-test migration.

## Regression?

Yes — fixes Dashboard behavior and test regressions introduced by the
Fluent UI v5 migration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants