diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs index 4c8cbc28..41befbc9 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs @@ -158,13 +158,15 @@ public class SiteCrudTests await Assertions.Expect(page.Locator("div.card", new() { HasText = name })).ToBeVisibleAsync(); // ── DELETE ──────────────────────────────────────────────────────────────── - // Re-locate the card after navigation; scope the kebab to avoid strict mode. + // Re-locate the card after navigation; scope kebab+delete to the .dropdown + // container inside the card to be defensive against strict-mode violations. var cardAfterEdit = page.Locator("div.card", new() { HasText = name }); - var kebab = cardAfterEdit.Locator("button[aria-label^='More actions']"); + var cardDropdown = cardAfterEdit.Locator(".dropdown"); + var kebab = cardDropdown.Locator("button[aria-label^='More actions']"); await kebab.ClickAsync(); - // Click Delete in the now-open dropdown — scoped to the card. - var deleteBtn = cardAfterEdit.Locator(".dropdown-menu button.dropdown-item.text-danger"); + // Click Delete in the now-open dropdown — scoped to the .dropdown container. + var deleteBtn = cardDropdown.Locator(".dropdown-menu button.dropdown-item.text-danger"); await deleteBtn.ClickAsync(); // Confirm the global danger dialog.