diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Notifications/NotificationActionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Notifications/NotificationActionTests.cs index b416d59c..e2636916 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Notifications/NotificationActionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Notifications/NotificationActionTests.cs @@ -310,17 +310,18 @@ public class NotificationActionTests var runId = Guid.NewGuid().ToString("N"); var marker = $"zztest-notif-wave4-{runId}"; - // Genuinely-stuck row: Retrying + back-dated 15 min (> the 10-min StuckAgeThreshold). - await NotificationDataSeeder.InsertNotificationAsync( - Guid.NewGuid(), marker, "wave4-stuck", - status: "Retrying", createdAt: DateTimeOffset.UtcNow.AddMinutes(-15), - sourceSite: "site-a"); - // Non-stuck row: Parked @ now (terminal-ish status + fresh timestamp → not stuck). - await NotificationDataSeeder.InsertParkedNotificationAsync( - Guid.NewGuid(), marker, "wave4-fresh", "site-a"); - try { + // Genuinely-stuck row: Retrying + back-dated 15 min (> the 10-min StuckAgeThreshold). + // Seeded inside the try so a mid-seed failure is still cleaned up by the finally. + await NotificationDataSeeder.InsertNotificationAsync( + Guid.NewGuid(), marker, "wave4-stuck", + status: "Retrying", createdAt: DateTimeOffset.UtcNow.AddMinutes(-15), + sourceSite: "site-a"); + // Non-stuck row: Parked @ now (Parked is a terminal status → never stuck, regardless of age). + await NotificationDataSeeder.InsertParkedNotificationAsync( + Guid.NewGuid(), marker, "wave4-fresh", "site-a"); + var page = await _fixture.NewAuthenticatedPageAsync(); await page.GotoAsync($"{PlaywrightFixture.BaseUrl}{NotificationReportUrl}"); await page.WaitForLoadStateAsync(LoadState.NetworkIdle); @@ -385,15 +386,16 @@ public class NotificationActionTests var runId = Guid.NewGuid().ToString("N"); var marker = $"zztest-notif-wave4-{runId}"; - // 51 Parked rows under one marker → 2 pages (50 + 1); the pager renders (> 50). - for (int i = 0; i < 51; i++) - { - await NotificationDataSeeder.InsertParkedNotificationAsync( - Guid.NewGuid(), marker, $"wave4-page-{i:D2}", "site-a"); - } - try { + // 51 Parked rows under one marker → 2 pages (50 + 1); the pager renders (> 50). + // Seeded inside the try so a mid-seed failure is still cleaned up by the finally. + for (int i = 0; i < 51; i++) + { + await NotificationDataSeeder.InsertParkedNotificationAsync( + Guid.NewGuid(), marker, $"wave4-page-{i:D2}", "site-a"); + } + var page = await _fixture.NewAuthenticatedPageAsync(); await page.GotoAsync($"{PlaywrightFixture.BaseUrl}{NotificationReportUrl}"); await page.WaitForLoadStateAsync(LoadState.NetworkIdle);