Task #242 finish — UnsTab drag-drop interactive Playwright E2E tests un-skip + pass
Closes the scope-out left by the #242 partial. Root cause of the blazor.web.js zero-byte response turned out to be two co-operating harness bugs: 1) The static-asset manifest was discoverable but the runtime needs UseStaticWebAssets to be called so the StaticWebAssetsLoader composes a PhysicalFileProvider per ContentRoot declared in staticwebassets.development.json (Admin source wwwroot + obj/compressed + the framework NuGet cache). Without that call MapStaticAssets resolves the route but has no ContentRoot map — so every asset serves zero bytes. 2) The EF InMemory DB name was being re-generated on every DbContext construction (the lambda body called Guid.NewGuid() inline), so the seed scope, Blazor circuit scope, and test-assertion scopes all got separate stores. Capturing the name as a stable string per fixture instance fixes the "cluster not found → page stays at Loading…" symptom. Fixes: - AdminWebAppFactory: * ApplicationName set on WebApplicationOptions so UseStaticWebAssets discovers the manifest. * builder.WebHost.UseStaticWebAssets() wired explicitly (matches what `dotnet run` does via MSBuild targets). * dbName captured once per fixture; the options lambda reads the captured string instead of re-rolling a Guid. - UnsTabDragDropE2ETests: the two [Fact(Skip=...)] tests un-skip. Suite state: 3 passed, 0 skipped, 0 failed. Task #242 closed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,37 +8,27 @@ using ZB.MOM.WW.OtOpcUa.Configuration;
|
||||
namespace ZB.MOM.WW.OtOpcUa.Admin.E2ETests;
|
||||
|
||||
/// <summary>
|
||||
/// Phase 6.4 UnsTab drag-drop E2E. Task #199 landed the scaffolding; task #242 drives the
|
||||
/// Blazor Server interactive circuit through a real drag-drop → confirm-modal → apply flow
|
||||
/// and a 409 concurrent-edit flow. Both interactive tests are currently
|
||||
/// <see cref="FactAttribute.Skip"/>-guarded — see below.
|
||||
/// Phase 6.4 UnsTab drag-drop E2E. Task #199 landed the scaffolding; task #242 (this file)
|
||||
/// drives the Blazor Server interactive circuit through a real drag-drop → confirm-modal
|
||||
/// → apply flow and a 409 concurrent-edit flow, both via Chromium.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>Prerequisite.</b> Chromium must be installed locally:
|
||||
/// <c>pwsh tests/ZB.MOM.WW.OtOpcUa.Admin.E2ETests/bin/Debug/net10.0/playwright.ps1 install chromium</c>.
|
||||
/// When the binary is missing the tests <see cref="Assert.Skip"/> rather than fail hard,
|
||||
/// so CI pipelines that don't run the install step still report green.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Current blocker (both interactive tests skipped).</b> The Blazor Server circuit
|
||||
/// never boots in the test-owned pipeline because <c>_framework/blazor.web.js</c>
|
||||
/// returns HTTP 200 with a zero-byte body. The asset's route is declared in the Admin
|
||||
/// project's <c>OtOpcUa.Admin.staticwebassets.endpoints.json</c> manifest, but the
|
||||
/// underlying file is shipped via the framework NuGet
|
||||
/// (<c>Microsoft.AspNetCore.App.Internal.Assets/_framework/blazor.web.js</c>) rather
|
||||
/// than the Admin's <c>wwwroot</c>. <see cref="AdminWebAppFactory"/> points the content
|
||||
/// root at the Admin assembly directory + maps hubs + runs in Development, so routing
|
||||
/// / auth / DbContext / hub negotiation all succeed — the only gap is wiring the
|
||||
/// framework-asset file provider into <c>MapStaticAssets</c> or <c>UseStaticFiles</c>.
|
||||
/// The drag-drop + 409 scenarios are fully written; un-skipping them is a matter of
|
||||
/// plumbing, not rewriting the test logic.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Options for closing the gap.</b> (a) Layer a composite file provider that maps
|
||||
/// <c>/_framework/*</c> into the NuGet cache at test-init time. (b) Launch the real
|
||||
/// <c>dotnet run --project Admin</c> process as a subprocess with an InMemory DB
|
||||
/// override — closest to the production composition. (c) Copy the framework asset
|
||||
/// files into the test project's output via MSBuild so <c>UseStaticFiles</c> with
|
||||
/// <c>ContentRootPath</c>=Admin bin finds them.
|
||||
/// <b>Harness notes.</b> <see cref="AdminWebAppFactory"/> points the content root at
|
||||
/// the Admin assembly directory + sets <c>ApplicationName</c> + calls
|
||||
/// <c>UseStaticWebAssets</c> so <c>/_framework/blazor.web.js</c> + <c>/app.css</c>
|
||||
/// resolve from the Admin's <c>staticwebassets.development.json</c> manifest (which
|
||||
/// stitches together Admin <c>wwwroot</c> + the framework NuGet cache). Hubs
|
||||
/// <c>/hubs/fleet</c> + <c>/hubs/alerts</c> are mapped so <c>ClusterDetail</c>'s
|
||||
/// <c>HubConnection</c> negotiation doesn't 500 at first render. The InMemory
|
||||
/// database name is captured as a stable string per fixture instance so the seed
|
||||
/// scope + Blazor circuit scope + test-assertion scope all share one backing store.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[Trait("Category", "E2E")]
|
||||
@@ -73,9 +63,7 @@ public sealed class UnsTabDragDropE2ETests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact(Skip = "Task #242 blocked on blazor.web.js asset resolution — see class docstring. " +
|
||||
"Test body is complete + validated against the scaffolding; un-skip once the framework " +
|
||||
"file provider is wired into AdminWebAppFactory.")]
|
||||
[Fact]
|
||||
public async Task Dragging_line_onto_new_area_shows_preview_modal_then_confirms_the_move()
|
||||
{
|
||||
await using var app = new AdminWebAppFactory();
|
||||
@@ -126,7 +114,7 @@ public sealed class UnsTabDragDropE2ETests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact(Skip = "Task #242 blocked on blazor.web.js asset resolution — see class docstring.")]
|
||||
[Fact]
|
||||
public async Task Preview_shown_then_peer_edit_applied_surfaces_409_conflict_modal()
|
||||
{
|
||||
await using var app = new AdminWebAppFactory();
|
||||
|
||||
Reference in New Issue
Block a user