From 3f88de932c684607307c72e4f3a5f1cff573fe69 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sat, 6 Jun 2026 12:19:38 -0400 Subject: [PATCH] =?UTF-8?q?test(e2e):=20harden=20Transport=20export=20test?= =?UTF-8?q?=20=E2=80=94=20render=20sentinel=20+=20step-scoped=20Next=20(re?= =?UTF-8?q?view=20fix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Transport/TransportExportTests.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportExportTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportExportTests.cs index 081ce804..53325235 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportExportTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Transport/TransportExportTests.cs @@ -57,7 +57,10 @@ public sealed class TransportExportTests { var page = await _fixture.NewAuthenticatedPageAsync("multi-role", "password"); await page.GotoAsync($"{PlaywrightFixture.BaseUrl}/design/transport/export"); - await page.WaitForLoadStateAsync(LoadState.NetworkIdle); + // Wait for Step-1 to render (OnInitializedAsync makes 8 repo calls over SignalR + // before the template tree appears — NetworkIdle is an unreliable proxy for this). + await Assertions.Expect(page.Locator("[data-testid='group-templates']")) + .ToBeVisibleAsync(new() { Timeout = 15_000 }); // ── STEP 1: Select ──────────────────────────────────────────────────────── // Narrow the tree to just the zztest template, then tick its checkbox. @@ -82,9 +85,12 @@ public sealed class TransportExportTests // ── STEP 2: Review ──────────────────────────────────────────────────────── // The seed group lists the picked template; Next is always enabled here. + // Scope the Next click to the Step-2 panel — identified by its unique + // #include-deps toggle — so it cannot accidentally match a Step-1 button. await Assertions.Expect(page.Locator("[data-testid='seed-group']")) .ToBeVisibleAsync(new() { Timeout = 15_000 }); - await page.Locator("button.btn.btn-primary:has-text('Next')").ClickAsync(); + await page.Locator("div:has(#include-deps) button.btn.btn-primary:has-text('Next')") + .ClickAsync(); // ── STEP 3: Encrypt ─────────────────────────────────────────────────────── const string passphrase = "zztest-passphrase-123";