From dd751be9179ed17056c923655904008bf45cf420 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 8 Sep 2026 09:45:41 -0400 Subject: [PATCH] test(playwright): Flow Debugger instance row matched through the data-test contract The instance row locator used Locator.GetByText scoped to the panel, which bypasses the [data-test='flow-instance-row'] contract InstancePicker rows are documented to carry. Match through the data-test attribute instead, with an exact-text regex since the test only knows the instance name (not its id, unlike Debug View's tests). Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29 --- .../Deployment/FlowDebuggerTests.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/FlowDebuggerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/FlowDebuggerTests.cs index 99e3f395..0a00613c 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/FlowDebuggerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/FlowDebuggerTests.cs @@ -1,4 +1,5 @@ using System.Globalization; +using System.Text.RegularExpressions; using Microsoft.Playwright; using ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Cluster; using Xunit; @@ -210,11 +211,14 @@ public class FlowDebuggerTests : IClassFixture // Instance selection goes through the shared InstancePicker combobox (prefix // "flow-instance"): typing the name filters the area tree and expands its - // ancestors, then the exact-text row is clicked to select and close the panel. + // ancestors, then the exact-text row is clicked to select and close the panel. The + // test only knows the instance NAME (not its id), so the row is matched through the + // data-test contract (flow-instance-row) with an exact-text regex rather than a + // free-text GetByText scan. var instanceInput = page.Locator("[data-test='flow-instance-input']"); await instanceInput.FillAsync(RigInstanceName); - var instancePanel = page.Locator("[data-test='flow-instance-panel']"); - var instanceRow = instancePanel.GetByText(RigInstanceName, new() { Exact = true }); + var instanceRow = page.Locator("[data-test='flow-instance-row']", + new() { HasTextRegex = new Regex($"^\\s*{Regex.Escape(RigInstanceName)}\\s*$") }); Skip.IfNot( await WaitForCountAsync(page, instanceRow), $"Instance {RigInstanceName} is not on the rig's site-a — run docker/seed-delmia-sim.sh.");