test(playwright): fix stale selectors after UI refactor (h1 headings, collapsed Topology/Audit disclosures, ParameterValueForm ids, method-select race)

This commit is contained in:
Joseph Doherty
2026-12-03 12:14:28 -05:00
parent 18311eb385
commit 5acb16ca07
23 changed files with 66 additions and 46 deletions
@@ -63,7 +63,7 @@ public class SmtpConfigTests
await page.GotoAsync($"{PlaywrightFixture.BaseUrl}{SmtpUrl}");
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
await Assertions.Expect(page.Locator("h4:has-text('SMTP Configuration')")).ToBeVisibleAsync();
await Assertions.Expect(page.Locator("h1:has-text('SMTP Configuration')")).ToBeVisibleAsync();
// Open the form. Prefer the empty-state Add button (Host starts empty); otherwise
// edit the first existing card (Host pre-filled — we clear it below).
@@ -90,7 +90,7 @@ public class SmtpConfigTests
// Cancel and confirm the form closed (Save button gone). Leaves config exactly as found.
await page.Locator("button.btn-outline-secondary:has-text('Cancel')").ClickAsync();
await Assertions.Expect(page.Locator("button.btn-success:has-text('Save')")).ToHaveCountAsync(0);
await Assertions.Expect(page.Locator("h4:has-text('SMTP Configuration')")).ToBeVisibleAsync();
await Assertions.Expect(page.Locator("h1:has-text('SMTP Configuration')")).ToBeVisibleAsync();
}
/// <summary>
@@ -108,7 +108,7 @@ public class SmtpConfigTests
await page.GotoAsync($"{PlaywrightFixture.BaseUrl}{SmtpUrl}");
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
await Assertions.Expect(page.Locator("h4:has-text('SMTP Configuration')")).ToBeVisibleAsync();
await Assertions.Expect(page.Locator("h1:has-text('SMTP Configuration')")).ToBeVisibleAsync();
// Web-first: assert the page resolved to EITHER a config card (Credentials '(stored)' /
// '(not set)') OR the empty-state, with retry so a slow Blazor init does not spuriously
@@ -154,7 +154,7 @@ public class SmtpConfigTests
await page.GotoAsync($"{PlaywrightFixture.BaseUrl}{SmtpUrl}");
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
await Assertions.Expect(page.Locator("h4:has-text('SMTP Configuration')")).ToBeVisibleAsync();
await Assertions.Expect(page.Locator("h1:has-text('SMTP Configuration')")).ToBeVisibleAsync();
// Open the first card's Edit form. StartEdit reloads EVERY field (including the stored
// credential, _credentials = smtp.Credentials), so re-saving untouched rewrites the