Skip to content

Replace explicit command after navigation with automatic dismissing by ChromeDriver. - #69416

Merged
ilonatommy merged 2 commits into
dotnet:mainfrom
ilonatommy:fix-navigation-tests
Sep 22, 2026
Merged

ilonatommy merged 2 commits into
dotnet:mainfrom
ilonatommy:fix-navigation-tests

Conversation

@ilonatommy

Copy link
Copy Markdown
Member

It looks like the affected NavigationLock E2E tests started failing after CI upgraded ChromeDriver.

The tests correctly register and trigger a beforeunload handler, but newer ChromeDriver versions automatically handle beforeunload prompts before they can be accessed through the classic WebDriver alert API. As a result, the following call throws NoAlertPresentException:

This is tracked by the ChromeDriver issue.

This PR configures routing test sessions to dismiss beforeunload prompts automatically.

Such dismissing cancels the attempted navigation and keeps the browser on the current page - the same action previously was performed by the explicit dismiss.

Fixes #66043
Fixes #66041

@ilonatommy ilonatommy self-assigned this Sep 21, 2026
@ilonatommy
ilonatommy requested a review from a team as a code owner September 21, 2026 15:36
Copilot AI lite review requested due to automatic review settings September 21, 2026 15:36
@ilonatommy ilonatommy added area-blazor Includes: Blazor, Razor Components feature-blazor-navigation labels Sep 21, 2026
@ilonatommy
ilonatommy deployed to copilot-pat-pool September 21, 2026 15:37 — with GitHub Actions Active
@ilonatommy
ilonatommy deployed to copilot-pat-pool September 21, 2026 15:37 — with GitHub Actions Active

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

The cached routing browser can retain a navigation lock and prevent subsequent tests from initializing correctly.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Updates routing E2E tests to automatically dismiss beforeunload prompts and removes obsolete alert handling.

Changes:

  • Configures automatic prompt dismissal for routing sessions.
  • Restores affected navigation tests.
  • Removes quarantine attributes and explicit alert dismissal calls.
File Summary
src/​Shared/​E2ETesting/​BrowserFixture.cs Adds automatic beforeunload dismissal; the cached browser may retain navigation locks and cancel subsequent test setup.
src/​Components/​test/​E2ETest/​Tests/​RoutingTest.cs Removes quarantine and obsolete alert handling.
src/​Components/​test/​E2ETest/​ServerExecutionTests/​NavigationLockPrerenderingTest.cs Removes quarantine and obsolete alert handling.

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

Comment thread src/Shared/E2ETesting/BrowserFixture.cs

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

🟢 Approval recommended

The reviewed changes address the ChromeDriver behavior with no unresolved review comments.

Review effort: Lite
Findings: None

Resolved since last review (1)

@ilonatommy
ilonatommy enabled auto-merge (squash) September 21, 2026 16:56

@oroztocil oroztocil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work

@ilonatommy
ilonatommy merged commit e47e89d into dotnet:main Sep 22, 2026
30 of 31 checks passed
@ilonatommy

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

wtgodbe pushed a commit that referenced this pull request Sep 22, 2026
…y ChromeDriver. (#69416) (#69440)

* Replace explicit command after navigation with automatic dismissing by ChromeDriver.

* Feedback: dismissing should be opt-in.

Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 23, 2026
wtgodbe added a commit that referenced this pull request Sep 23, 2026
* Merge pull request #69426 from dotnet/darc-release/11.0-1a353f84-3fb6-4f62-815a-b32e480af1f0

[release/11.0] Source code updates from dotnet/dotnet

* Replace explicit command after navigation with automatic dismissing by ChromeDriver. (#69416) (#69440)

* Replace explicit command after navigation with automatic dismissing by ChromeDriver.

* Feedback: dismissing should be opt-in.

Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>

* Fix Native AOT completion for JS-invoked Tasks (#69437)

* Fix Native AOT completion for JS-invoked Tasks

Use the declared JS-invokable return type to avoid dynamically constructing a result getter for non-generic Task and ValueTask completions. Keep unsuccessful asynchronous completions mutually exclusive and cover the Native AOT browser promise boundary.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Expand Native AOT async JS interop coverage

Exercise Task, ValueTask, Task<T>, and ValueTask<T> through invokeMethodAsync in the Native AOT browser test. Preserve the existing fault-path structure while handling cancellation separately.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Support generic JS interop tasks under Native AOT

Use preserved Task<T>.Result and ValueTask<T>.AsTask members when dynamic code is unavailable. Expand Native AOT browser coverage to completed and asynchronous task shapes with an application-defined value type.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Remove DeviceBoundSessions implementation (#69462)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>

* Update dependencies from build 333446 (#69444)

Updated Dependencies:
Microsoft.NET.Runtime.WebAssembly.Sdk, Microsoft.NETCore.BrowserDebugHost.Transport, Microsoft.NET.Runtime.MonoAOTCompiler.Task, dotnet-ef, Microsoft.Bcl.AsyncInterfaces, Microsoft.Bcl.Cryptography, Microsoft.Bcl.TimeProvider, Microsoft.EntityFrameworkCore, Microsoft.EntityFrameworkCore.Design, Microsoft.EntityFrameworkCore.InMemory, Microsoft.EntityFrameworkCore.Relational, Microsoft.EntityFrameworkCore.Sqlite, Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools, Microsoft.Extensions.Caching.Abstractions, Microsoft.Extensions.Caching.Memory, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Abstractions, Microsoft.Extensions.Configuration.Binder, Microsoft.Extensions.Configuration.CommandLine, Microsoft.Extensions.Configuration.EnvironmentVariables, Microsoft.Extensions.Configuration.FileExtensions, Microsoft.Extensions.Configuration.Ini, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.Configuration.UserSecrets, Microsoft.Extensions.Configuration.Xml, Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.DependencyInjection.Abstractions, Microsoft.Extensions.DependencyModel, Microsoft.Extensions.Diagnostics, Microsoft.Extensions.Diagnostics.Abstractions, Microsoft.Extensions.FileProviders.Abstractions, Microsoft.Extensions.FileProviders.Composite, Microsoft.Extensions.FileProviders.Physical, Microsoft.Extensions.FileSystemGlobbing, Microsoft.Extensions.HostFactoryResolver.Sources, Microsoft.Extensions.Hosting, Microsoft.Extensions.Hosting.Abstractions, Microsoft.Extensions.Http, Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Abstractions, Microsoft.Extensions.Logging.Configuration, Microsoft.Extensions.Logging.Console, Microsoft.Extensions.Logging.Debug, Microsoft.Extensions.Logging.EventLog, Microsoft.Extensions.Logging.EventSource, Microsoft.Extensions.Logging.TraceSource, Microsoft.Extensions.Options, Microsoft.Extensions.Options.ConfigurationExtensions, Microsoft.Extensions.Options.DataAnnotations, Microsoft.Extensions.Primitives, Microsoft.Internal.Runtime.AspNetCore.Transport, Microsoft.NETCore.App.Ref, Microsoft.NETCore.Platforms, System.Collections.Immutable, System.Composition, System.Configuration.ConfigurationManager, System.Diagnostics.DiagnosticSource, System.Diagnostics.EventLog, System.Diagnostics.PerformanceCounter, System.DirectoryServices.Protocols, System.Formats.Asn1, System.Formats.Cbor, System.IO.Hashing, System.IO.Pipelines, System.Memory.Data, System.Net.Http.Json, System.Net.Http.WinHttpHandler, System.Net.ServerSentEvents, System.Numerics.Tensors, System.Reflection.Metadata, System.Resources.Extensions, System.Runtime.Caching, System.Security.Cryptography.Pkcs, System.Security.Cryptography.Xml, System.Security.Permissions, System.ServiceProcess.ServiceController, System.Text.Encodings.Web, System.Text.Json, System.Threading.AccessControl, System.Threading.Channels, System.Threading.RateLimiting (Version 11.0.0-rc.2.26471.109 -> 11.0.0-rc.2.26472.108)
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Archives, Microsoft.DotNet.Build.Tasks.Installers, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Helix.JobMonitor, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.SharedFramework.Sdk (Version 11.0.0-beta.26471.109 -> 11.0.0-beta.26472.108)
Microsoft.Web.Xdt (Version 3.3.0-rc.2.26471.109 -> 3.3.0-rc.2.26472.108)
NuGet.Frameworks, NuGet.Packaging, NuGet.Versioning (Version 7.12.0-rc.47209 -> 8.0.0-rc.47408)
[[ commit created by automation ]]

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

---------

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
Co-authored-by: Javier Calvarro Nelson <jacalvar@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components feature-blazor-navigation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quarantine NavigationLockPrerenderingTest Quarantine RoutingTest.NavigationLock_CanBlockExternalNavigation

3 participants