test(e2e): symmetric page-load guard + document the pause-settle window (review polish)
This commit is contained in:
+10
-2
@@ -84,6 +84,9 @@ public class DeploymentsRealtimeTests : IClassFixture<DeploymentFixture>
|
|||||||
var page = await _pw.NewAuthenticatedPageAsync();
|
var page = await _pw.NewAuthenticatedPageAsync();
|
||||||
await page.GotoAsync($"{PlaywrightFixture.BaseUrl}/deployment/deployments");
|
await page.GotoAsync($"{PlaywrightFixture.BaseUrl}/deployment/deployments");
|
||||||
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||||
|
// Confirm the page loaded before interacting (symmetric with Fact A) — a failed
|
||||||
|
// load then surfaces as a clear heading-miss rather than a confusing Pause timeout.
|
||||||
|
await Assertions.Expect(page.Locator("h4:has-text('Deployment Status')")).ToBeVisibleAsync();
|
||||||
|
|
||||||
// Pause — the click round-trips over the circuit, so _autoRefresh is committed
|
// Pause — the click round-trips over the circuit, so _autoRefresh is committed
|
||||||
// false before the deploy below. The button flipping to "Resume" proves it.
|
// false before the deploy below. The button flipping to "Resume" proves it.
|
||||||
@@ -93,8 +96,13 @@ public class DeploymentsRealtimeTests : IClassFixture<DeploymentFixture>
|
|||||||
|
|
||||||
await CliRunner.DeployInstanceAsync(instanceId);
|
await CliRunner.DeployInstanceAsync(instanceId);
|
||||||
|
|
||||||
// Paused: StatusChanged is ignored, so the row is NOT auto-added. Settle briefly to
|
// Paused: StatusChanged is ignored, so the row is NOT auto-added. The push chain
|
||||||
// give any (erroneous) push time to manifest, then assert absence.
|
// (deploy write → StatusChanged → InvokeAsync re-render → SignalR diff) completes
|
||||||
|
// well under a second on a healthy cluster, so a 2s settle is ample to let any
|
||||||
|
// erroneous push manifest before we assert absence. This is the one deliberate
|
||||||
|
// fixed wait — a negative real-time assertion has no DOM event to await on the
|
||||||
|
// "stayed absent" path. The Refresh-restores assertion below is the independent
|
||||||
|
// positive guard if a loaded cluster ever makes this settle empirically tight.
|
||||||
var row = page.Locator("table tbody tr", new() { HasText = uniqueName });
|
var row = page.Locator("table tbody tr", new() { HasText = uniqueName });
|
||||||
await page.WaitForTimeoutAsync(2_000);
|
await page.WaitForTimeoutAsync(2_000);
|
||||||
await Assertions.Expect(row).ToHaveCountAsync(0);
|
await Assertions.Expect(row).ToHaveCountAsync(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user