test(playwright): fix stale selectors after UI refactor (h1 headings, collapsed Topology/Audit disclosures, ParameterValueForm ids, method-select race)

This commit is contained in:
Joseph Doherty
2026-12-03 12:14:28 -05:00
parent 18311eb385
commit 5acb16ca07
23 changed files with 66 additions and 46 deletions
@@ -55,7 +55,7 @@ public class FlowDebuggerTests : IClassFixture<FlowDebuggerFixture>
// to Predicted and the method's ParameterValueForm (the same typed form the script
// pane uses, inputs addressed by field id) appears.
await Assertions.Expect(page.Locator("[data-test='flow-state']")).ToHaveTextAsync("Predicted", new() { Timeout = 15_000 });
var input = page.Locator("#param-Text");
var input = page.Locator("[data-param-path='Text']");
await Assertions.Expect(input).ToBeVisibleAsync();
// @bind commits on change (blur), so commit the value as its own circuit message before Run.
@@ -136,7 +136,7 @@ public class FlowDebuggerTests : IClassFixture<FlowDebuggerFixture>
await Assertions.Expect(paramsCard.Or(noParamsNote)).ToBeVisibleAsync(new() { Timeout = 15_000 });
if (await paramsCard.IsVisibleAsync())
{
var workOrder = page.Locator("#param-WorkOrder");
var workOrder = page.Locator("[data-param-path='WorkOrder']");
if (await workOrder.CountAsync() > 0)
{
await workOrder.FillAsync("WO-PW");
@@ -299,6 +299,10 @@ public class FlowDebuggerTests : IClassFixture<FlowDebuggerFixture>
await Assertions.Expect(select).ToBeVisibleAsync();
// The option list is loaded server-side on init; wait for our method to be present.
await Assertions.Expect(select.Locator($"option[value='{MethodIdText}']")).ToHaveCountAsync(1, new() { Timeout = 15_000 });
// The static-rendered <select> is visible before the Blazor circuit attaches its change
// handler; a selection made in that window is silently lost (state stays "Not run").
// Wait for the circuit to settle, then select.
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
await select.SelectOptionAsync(MethodIdText);
}