Skip to content

Fix dashboard playwright flaky tests#13767

Merged
JamesNK merged 3 commits intomainfrom
jamesnk/playwright-flakytests
Jan 6, 2026
Merged

Fix dashboard playwright flaky tests#13767
JamesNK merged 3 commits intomainfrom
jamesnk/playwright-flakytests

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Jan 6, 2026

Description

I ran these in a loop locally and they passed after changes. Hopefully no trouble on CI.

Fixes #7921
Fixes #9152

Copilot AI review requested due to automatic review settings January 6, 2026 04:48
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13767

Or

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

Copy link
Contributor

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 fixes two flaky Playwright tests in the Aspire Dashboard by improving timeout handling and adding explicit wait conditions for page navigation and state changes.

Key changes:

  • Replace hardcoded timeout value with TestConstants.LongTimeoutDuration for consistency
  • Add explicit wait for URL navigation after login to avoid race conditions
  • Close settings dialog before page reload to ensure state persistence
  • Replace custom retry logic with Playwright's native assertion mechanism

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/Aspire.Dashboard.Tests/Integration/Playwright/Infrastructure/PlaywrightFixture.cs Replaces hardcoded 30_000ms timeout with TestConstants.LongTimeoutDuration constant for consistency with the rest of the codebase
tests/Aspire.Dashboard.Tests/Integration/Playwright/BrowserTokenAuthenticationTests.cs Removes QuarantinedTest attribute and adds explicit WaitForURLAsync call to wait for navigation completion after login, fixing the timeout issue
tests/Aspire.Dashboard.Tests/Integration/Playwright/AppBarTests.cs Removes ActiveIssue for macOS, adds explicit dialog close before page reload, replaces custom retry logic with Playwright's ToBeCheckedAsync(), and ensures consistent timeout handling throughout

@JamesNK JamesNK enabled auto-merge (squash) January 6, 2026 05:55
@davidfowl
Copy link
Member

Are these tests easily runnable locally?

@JamesNK JamesNK merged commit b45cde4 into main Jan 6, 2026
286 checks passed
@JamesNK JamesNK deleted the jamesnk/playwright-flakytests branch January 6, 2026 06:15
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Jan 6, 2026
@JamesNK
Copy link
Member Author

JamesNK commented Jan 6, 2026

Are these tests easily runnable locally?

Yes. dotnet test runs them

@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

4 participants