From 917e5f30bf1dffbd47f2f9c5a5843eaed5146699 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 5 Jun 2026 10:34:07 -0400 Subject: [PATCH] test(e2e): structural modal discriminator + simpler post-delete wait (review fixes) --- .../Design/TemplateCrudTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Design/TemplateCrudTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Design/TemplateCrudTests.cs index 41c2a532..3b937abb 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Design/TemplateCrudTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Design/TemplateCrudTests.cs @@ -62,7 +62,9 @@ public class TemplateCrudTests await page.ClickAsync("button.btn.btn-primary.btn-sm:has-text('Add Attribute')"); // The modal is a page-local .modal.show.d-block — NOT the global DialogHost. - var modal = page.Locator(".modal.show.d-block"); + // DialogHost adds a `fade` class; the page-local modal does not, so :not(.fade) + // ensures we match only the page-local Add-Attribute modal. + var modal = page.Locator(".modal.show.d-block:not(.fade)"); await Assertions.Expect(modal).ToBeVisibleAsync(); await Assertions.Expect(modal.Locator(".modal-title")).ToHaveTextAsync("Add Attribute"); @@ -92,7 +94,8 @@ public class TemplateCrudTests await confirmBtn.ClickAsync(); // After delete, Blazor navigates back to /design/templates (the list page). - await PlaywrightFixture.WaitForPathAsync(page, "/design/templates", excludePath: $"/design/templates/{page.Url.Split('/').Last()}"); + // excludePath: "/design/templates/" rejects any /design/templates/{id} detail URL. + await PlaywrightFixture.WaitForPathAsync(page, "/design/templates", excludePath: "/design/templates/"); await page.WaitForLoadStateAsync(LoadState.NetworkIdle); // The template name must no longer appear in the tree view.