Skip to content

Assert WebAssembly browser configuration environment name - #69702

Merged
maraf merged 1 commit into
mainfrom
pureween-environment-name-draft-pr
Oct 21, 2026
Merged

maraf merged 1 commit into
mainfrom
pureween-environment-name-draft-pr

Conversation

@PureWeen

@PureWeen PureWeen commented Oct 7, 2026

Copy link
Copy Markdown
Member

Assert WebAssembly environment name from browser configuration

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Assert the actual WebAssembly environment on initial and enhanced navigation.

Description

The existing browser-configuration E2E tests verify environment variables but do not verify the hosting environment name. Add an exact assertion against a non-default name in both existing tests, while retaining their WebAssembly, environment-variable, and enhanced-navigation DOM-preservation checks.

The test fixture opts into the custom browser environment through configuration, so other classes using the shared startup keep their existing defaults. The existing client page reads IHostEnvironment.EnvironmentName only after its first interactive render; prerendered server output and the runtime's default Development environment cannot satisfy the assertion.

This is test-only coverage, not a fix for a current runtime defect. No shipping code, public API, dependency manifests, or test method names change. Inline documentation is not applicable to the added assertions and test-asset output.

Validation

Validation uses current public main 851622243f8aad5d72636142ec2414be966c2449 and the real Selenium startup/navigation path.

  • The unchanged original tests pass both intact and with a temporary name-only mutation.
  • The strengthened enhanced-navigation test fails specifically with expected BrowserConfigurationTestEnvironment, actual Development, after both variables, WebAssembly execution, and preserved HTML have passed. The initial-load test remains green.
  • The mutation targets the current Boot.Web.ts browser-configuration consumer and omits only the enhanced-navigation environment name. Freshly built, served JavaScript was checked against the in-tree bundle. The mutation and temporary diagnostics are removed.
  • Captured browser/network logs identify a /favicon.ico 404 on initial loads and existing legacy-initializer warnings; no other failed responses or resource-loading failures were observed in those captures.

Commands were run from the repository root after . .\activate.ps1 for .NET commands:

Command Result
npm run build Passed; builds the prerequisite JavaScript workspaces and in-tree Blazor assets.
npm run build from src\Components\Web.JS Passed for the temporary mutant and restored source.
dotnet build src\Components\test\E2ETest\Microsoft.AspNetCore.Components.E2ETests.csproj --no-restore -v:q -p:UseIisNativeAssets=false Passed with referenced test applications rebuilt.
dotnet test src\Components\test\E2ETest\Microsoft.AspNetCore.Components.E2ETests.csproj --no-build --filter "FullyQualifiedName~BrowserConfigurationTest|FullyQualifiedName~GlobalInteractivityTest.CanNavigateFromStaticToInteractiveAndBack|FullyQualifiedName~GlobalInteractivityTest.CanNavigateBetweenStaticPagesViaEnhancedNav" --logger "console;verbosity=normal" Passed all four Facts with restored source and no diagnostic instrumentation.

Coverage is limited to the two existing browser-configuration Facts and adjacent navigation controls, not the full Components suite or all render modes.

Fixes: N/A. No open tracking issue was identified for this coverage-only follow-up. Related historical context: #67067 (closed) and #67387 (merged). This draft does not claim to fix or close either.

@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Oct 7, 2026
@maraf

maraf commented Oct 8, 2026

Copy link
Copy Markdown
Member

It looks good to me 👍

@PureWeen
PureWeen marked this pull request as ready for review October 14, 2026 18:28
@PureWeen
PureWeen requested a review from a team as a code owner October 14, 2026 18:28
Copilot AI balanced review requested due to automatic review settings October 14, 2026 18:28

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.

🔵 Needs a closer look

No blocking findings were identified, but missing frozen review evidence leaves automated approval checks incomplete.

0 open findings

What changed in this PR

Strengthens test-only coverage for WebAssembly hosting environment names on initial load and enhanced navigation.

Changes:

  • Configures a non-default browser environment for this test fixture.
  • Displays the environment name after interactive rendering.
  • Adds exact assertions while preserving existing environment-variable and navigation checks.
File Description
src/​Components/​test/​testassets/​Components.WasmMinimal/​Pages/​BrowserConfigurationEnvVars.razor Displays the interactive hosting environment name.
src/​Components/​test/​testassets/​Components.TestServer/​RazorComponentEndpointsStartup.cs Adds an opt-in browser environment override.
src/​Components/​test/​E2ETest/​Tests/​BrowserConfigurationTest.cs Configures and asserts the custom environment in both tests.

🧠 Review effort: Balanced


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

@maraf

maraf commented Oct 21, 2026

Copy link
Copy Markdown
Member

/ba-g Failures are unrelated

@maraf
maraf merged commit 2d105dd into main Oct 21, 2026
29 of 33 checks passed
@maraf
maraf deleted the pureween-environment-name-draft-pr branch October 21, 2026 09:54
@maraf
maraf temporarily deployed to copilot-pat-pool October 21, 2026 09:54 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool October 21, 2026 09:55 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool October 21, 2026 09:55 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool October 21, 2026 09:57 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool October 21, 2026 09:58 — with GitHub Actions Inactive
@maraf
maraf temporarily deployed to copilot-pat-pool October 21, 2026 09:59 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 3%

No docs needed: the PR only adds assertions to E2E tests and test assets.

Documentation surfaces considered

  • Conceptual article: Not required — Only test and test-asset files changed; no public API or behavior change.
  • Migration guidance: Not required — No user-facing change to adopt on upgrade.
  • Breaking change: Not required — No compatibility impact; tests only.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 8e185ff7 Deployed Oct 21, 2026 by maraf via conclusion #82
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants