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.");