test(playwright): repair 14 selector-drift failures from two Central UI refactors
All 14 pre-existing Playwright failures triage to selector drift, not rig data,
timing, or application defects — every one is a test-side assumption that two
merged UI refactors invalidated without updating this suite.
`9e243493` (2026-08-11 density sweep + Theme 0.4.1) regrouped page/dialog action
buttons into `btn-group btn-group-sm`, moving the size class off the button and
onto the group. Twelve selectors still pinned `.btn-sm` on the button itself:
ConfigurationAuditLog's Search (4 tests), the Topology Create/Move dialog footers
(3), the Notification Lists row Edit/Delete (2), and the Notification Report row
Retry/Discard (2). The same sweep re-cast SiteForm's per-node subsections from
bare `<h6>` headings to Bootstrap cards, so `h6:has-text('Node A')` matches
nothing (1). Note the swept surfaces are a subset — the recipient table on the
notification-list edit form, OffsetPager, DiffDialog and friends still carry
`.btn-sm` on the button, so the selectors are deliberately asymmetric; the
remaining `.btn-sm` selectors in this suite were each re-verified against current
markup rather than swept along.
`a506b19d` moved TemplateEdit's page-embedded modals onto the DialogService host.
The attribute modal is now the DialogHost modal (`modal fade show d-block`, title
in an h5), so the `:not(.fade)` guard written to exclude DialogHost — plus the
`h6.modal-title` assertion — excluded the very modal under test (2). TemplateEdit
renders no page-local modal any more, so the guard has nothing left to guard.
Comments at each site record why the size class is absent, so a future reader
does not "fix" the selectors back.
Verified: 14 failed / 158 passed baseline -> the 36 tests in the seven affected
classes all green; solution build 0 warnings / 0 errors.
This commit is contained in:
@@ -65,10 +65,13 @@ public class TemplateCrudTests : IClassFixture<DeploymentFixture>
|
||||
// Click Add Attribute.
|
||||
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.
|
||||
// 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)");
|
||||
// TemplateEdit's four page-embedded modals were migrated onto the global
|
||||
// DialogService host, so the Add-Attribute modal IS the DialogHost modal now
|
||||
// (`modal fade show d-block`, title in an h5). The old `:not(.fade)` guard
|
||||
// against the page-local variant would exclude it — TemplateEdit renders no
|
||||
// page-local modal of its own any more, so `.modal.show.d-block` is
|
||||
// unambiguous on this page.
|
||||
var modal = page.Locator(".modal.show.d-block");
|
||||
await Assertions.Expect(modal).ToBeVisibleAsync();
|
||||
await Assertions.Expect(modal.Locator(".modal-title")).ToHaveTextAsync("Add Attribute");
|
||||
|
||||
@@ -242,12 +245,13 @@ public class TemplateCrudTests : IClassFixture<DeploymentFixture>
|
||||
await page.ClickAsync("button[aria-label=\"More actions for Val\"]");
|
||||
await page.ClickAsync("button.dropdown-item:has-text('Edit…')");
|
||||
|
||||
// The page-local attribute modal is .modal.show.d-block WITHOUT `fade`
|
||||
// (the DialogHost confirm modal HAS `fade`). :not(.fade) pins the
|
||||
// page-local one.
|
||||
var modal = page.Locator(".modal.show.d-block:not(.fade)");
|
||||
// The attribute modal is rendered by the global DialogService host since
|
||||
// TemplateEdit's page-embedded modals were migrated to it — `modal fade show
|
||||
// d-block` with the title in an h5. TemplateEdit renders no page-local modal
|
||||
// of its own, so `.modal.show.d-block` is unambiguous on this page.
|
||||
var modal = page.Locator(".modal.show.d-block");
|
||||
await Assertions.Expect(modal).ToBeVisibleAsync();
|
||||
await Assertions.Expect(modal.Locator("h6.modal-title")).ToHaveTextAsync("Edit Attribute");
|
||||
await Assertions.Expect(modal.Locator("h5.modal-title")).ToHaveTextAsync("Edit Attribute");
|
||||
|
||||
// When editing, the Name input is rendered readonly (readonly="@editing").
|
||||
await Assertions.Expect(
|
||||
|
||||
Reference in New Issue
Block a user