diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs index f2b34c3b..644f655e 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs @@ -808,8 +808,11 @@ public class AuditLogPageTests await row.ClickAsync(); // The drawer opens for the DbOutbound row, but the cURL action — gated - // on IsApiChannel — is absent. + // on IsApiChannel — is absent. Wait for the AuditEventDetail body + // ([data-test='drawer-fields']) to render BEFORE the negative count + // assertion, so a not-yet-rendered child can't false-pass count 0. await Assertions.Expect(page.Locator("[data-test='audit-drilldown-drawer']")).ToBeVisibleAsync(); + await Assertions.Expect(page.Locator("[data-test='drawer-fields']")).ToBeVisibleAsync(); await Assertions.Expect(page.Locator("[data-test='copy-as-curl']")).ToHaveCountAsync(0); } finally @@ -829,8 +832,8 @@ public class AuditLogPageTests // the drawer, dismiss via the X, re-open, then dismiss via the footer, // asserting the drawer is gone (count 0) after each. // Escape-to-close is NOT wired on AuditDrilldownDrawer (only - // ExecutionDetailModal has a keydown handler); covering the X and - // footer-Close paths that ARE wired. + // ExecutionDetailModal has a keydown handler). The backdrop is also wired + // to HandleClose, but we cover the X and footer-Close paths here for brevity. var runId = Guid.NewGuid().ToString("N"); var targetPrefix = $"playwright-test/wave4-audit2c/{runId}/"; var apiId = Guid.NewGuid();