Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 3, 2025

Backport of #63132 to release/10.0

/cc @ilonatommy

Run entire E2E test with consistent enhanced navigation suppression setting

Enhanced navigation suppression was per page, after navigating away we were falling back to enhanced navigation, regardless of the test settings. It's because we were treating the storage as temporary measure where we were setting the suppression flag and instantly removing it after reading it in blazor start function. For tests that never navigated away (did not re-trigger blazor boot function) it was enough but for other ones, not.

Description

  • The enhanced navigation suppression flag is saved in the storage for the entire test runtime.
  • To avoid usage of the flag by multiple tests, we always try to clean the session storage from it on disposal.
  • Consecutive navigations in the test will run with same settings as the first page load.
  • This PR fixed order of actions: we should navigate to a page only after the suppression method got called.
  • It also enabled tests that got disabled because of issues with enhanced navigation suppression.
  • Session storage has to be available if we want to suppress enhanced navigation. If a developer wrote a test that is not navigating to any page and chose to skip the automatic navigation in EnhancedNavigationTestUtil.SuppressEnhancedNavigation, they will get an exception like:
Failed to read the 'sessionStorage' property from 'Window': Access 

SuppressEnhancedNavigation appends to the exception message an instruction how to fix this situation.

  • To be able to clean the sessionStorage, we have to have access to it. It's accessible only on loaded pages, so we chose the index page as the secure place for conducting the cleanup. To assure we're at the correct location we're checking for "session-storage-anchor" tag, adding it to test projects.
  • This PR is changing expectations of test apps that got broken during development because they were not looking for a specific html element ID but for an element type (h1/p) etc. The selectors got more precise.
  • Executing JS script to find the location of an element was infrequently failing and was blocked by the same quarantine issue. This PR changes the location finding method to rely less on JS, more on selenium tooling.

Fixes #60875

Customer Impact

No impact, this is tests only.

Regression?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

Just tests improvements.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

… that don't support session storage at the same time. Allow single tests to request id assignment.
…rease timeouts for landing page assert that can be too short once in every 20 runs.
… inheritance to ServerTestBase, so that it calls ID granting method as well.
…ems locally because it runs in a small window).
@github-actions github-actions bot requested a review from a team as a code owner September 3, 2025 15:38
@ilonatommy ilonatommy self-assigned this Sep 3, 2025
@ilonatommy ilonatommy added area-blazor Includes: Blazor, Razor Components test-fixed labels Sep 3, 2025
@ilonatommy ilonatommy added this to the 10.0-rc2 milestone Sep 3, 2025
@ilonatommy ilonatommy added the tell-mode Indicates a PR which is being merged during tell-mode label Sep 3, 2025
@wtgodbe
Copy link
Member

wtgodbe commented Sep 5, 2025

Is this ready to merge?

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 tell-mode Indicates a PR which is being merged during tell-mode test-fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants