From 1cbf26096946bca34b4830901bbe24f059ee1c56 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 5 Jun 2026 10:46:57 -0400 Subject: [PATCH] test(e2e): add wizard sentinel waits + tighten audit-link assertion (review fixes) --- .../Transport/TransportImportTests.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportImportTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportImportTests.cs index 4fb4763c..df66bc83 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportImportTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportImportTests.cs @@ -98,13 +98,19 @@ public class TransportImportTests await page.Locator("button.btn.btn-primary:has-text('Unlock')").ClickAsync(); // ── STEP 3: Diff ──────────────────────────────────────────────────────────── + // Wait for the passphrase input to disappear before asserting the diff + // summary — this gives a clearer failure when decrypt/preview is slow and + // prevents a race between the decrypt completion and the render of the diff. + await Assertions.Expect(page.Locator("#import-passphrase")) + .ToBeHiddenAsync(new() { Timeout = 20_000 }); + // A brand-new template renders as a static Add item with no blocker, so // the diff summary appears and the Next button is enabled. await Assertions.Expect(page.Locator("[data-testid='diff-summary']")) .ToBeVisibleAsync(new() { Timeout = 15_000 }); var diffNext = page.Locator("button.btn.btn-primary:has-text('Next')"); - await Assertions.Expect(diffNext).ToBeEnabledAsync(); + await Assertions.Expect(diffNext).ToBeEnabledAsync(new() { Timeout = 15_000 }); await diffNext.ClickAsync(); // ── STEP 4: Confirm ────────────────────────────────────────────────────────── @@ -128,7 +134,7 @@ public class TransportImportTests await Assertions.Expect(auditLink).ToBeVisibleAsync(); var href = await auditLink.GetAttributeAsync("href"); Assert.NotNull(href); - Assert.StartsWith("/audit/configuration?bundleImportId=", href); + Assert.Matches(@"^/audit/configuration\?bundleImportId=[0-9a-fA-F\-]{36}$", href); } finally {