Skip to content

fix(e2e): repair Playwright E2E suite (#14) - #18

Merged
bjinwright merged 16 commits into
developfrom
feature/issue-14-playwright-e2e-repair
Sep 29, 2026
Merged

bjinwright merged 16 commits into
developfrom
feature/issue-14-playwright-e2e-repair

Conversation

@bjinwright

Copy link
Copy Markdown
Member

Summary

Repairs the Playwright E2E suite (issue #14) that was red on the chore/drop-tailwind-cdn baseline — ~64 failures across select / visual / mobile / dialog-toast-toggle, plus residual countdown / card / component-builder clusters. Each cluster is an atomic commit; real product bugs are fixed in src/, and brittle specs are only adjusted where the component itself was correct.

Pass counts: npx playwright test went from 214 passed / 64 failed (QE baseline at eb16901) to 270 passed / 0 failed (exit 0).

Clusters

Cluster Commit What changed
Hardcoded :3000 c76f47d Dropped hardcoded localhost:3000 URLs; specs use baseURL
Test server e1ba2ba Enabled Playwright webServer (auto-start scripts/dev-server.js, reuseExistingServer) + README docs
Select e940279 Repaired select spec cluster (interactive, search, stacking)
Visual regression 7273bc6 Refreshed dry2.css visual snapshots (light/dark + responsive)
Mobile d73e71e Repaired mobile button/tabs/card overflow + touch specs
Dialog / toast / toggle 94c2bea Event/state-based waits; fixed toast positioning + toggle ID collision in src/
Countdown 1024599 Rebuild units each tick; in-test future target dates (were wall-clock dependent)
Card 5bb56ae Aligned variant/elevation assertions to dry2.css classes (card, shadow)
Component builder cb91c9d Wired text inputs into preview updates; sized copy SVG explicitly (dropped w-3 h-3)

Notes

Test plan

  • npx playwright test -> 270 passed / 0 failed (exit 0)
  • npm run test:unit -> baseline maintained (346 passing / 4 pending / 242 failing; pre-existing expect is not defined in tests/unit/components/*)
  • npx eslint clean on all changed files
  • No test.skip without a reason; no widened tolerances to hide bugs

Refs #14 (do not close until verified on develop).

Select stacking spec navigated to http://localhost:3000 which refused
connections whenever the default dev-server port differed; go through
Playwright baseURL so the suite is server-agnostic.
Playwright webServer now boots scripts/dev-server.js on :8086 (reusing
any running server) so npx playwright test is self-contained; README
documents the manual python http.server fallback.
The select dropdown portals to document.body while open (intended
stacking behavior), but 15 tests still looked for the panel inside the
component and timed out. Scope open-state queries through a
dropdownPanel() helper that follows the panel in either position; the
component itself is correct and unchanged.

Baseline failures fixed: open/select/search, tag removal, Select All,
Clear, click-outside close, no-results, change event, console errors,
getValue API, dynamic options, checkmark, focus search, reset search.
The spec pointed at root test-*-dry2css-manual.html fixtures that were
never committed, so every case screenshotted a 'Not found' page. Add
minimal dry2.css fixture pages for button/card/badge, make the spec use
baseURL-relative paths, and refresh all 9 snapshots under the current
dry2.css theme (light/dark + mobile/tablet/desktop all render content).
Real layout bugs, not test tolerances:
- dry2.css lacked .overflow-x-auto so dry-code blocks and API tables
  widened the page on 375px viewports; define the utility, wrap the
  button/tabs showcase tables in it, and let long demo rows wrap.
- .dry-tabs-list now scrolls horizontally and tab buttons get a 44px
  min touch target.

Specs: hasTouch on the mobile contexts (tap() required it) and
baseURL-relative navigation. Mobile specs pass lint and leave the
eslint quarantine.
Dialog specs referenced stale showcase markup (wrong trigger texts,
backdrop/class assertions); rewrite to match current component API and
assert real open/close/direction/programmatic behavior.

Toast close button timed out because the injected CSS lacked container
positioning, dropping it off-viewport; scope fixed positioning into
toast.js.

Toggle demo event log never updated: the inner checkbox reused the host
element's id, breaking label association and the change handler; give it
a unique id. The interactive test also force-clicked the sr-only 1px
input; click the visible switch instead.

Cites baseline dialog/toast/toggle timeouts and assertion failures.
Countdown units were rebuilt in place, so units crossing zero lingered
and newly-relevant ones never appeared; rebuild the set each tick. The
target-date and show-zeros specs read a wall-clock fixture date that has
now expired, so set future target dates in-test to make them independent
of the current date.
Variant and elevation assertions checked Tailwind classes (bg-white,
shadow-md) that no longer exist after the dry2.css migration. Point them
at the classes the card actually emits (card for the fill, standalone
shadow for medium elevation) so they match the rendered markup.
The text control input handler only wired range and color inputs, so
editing a text property never refreshed the preview; route any
data-property input through _updateProperty on input. The copy-button SVG
sized itself with dropped w-3 h-3 utilities, collapsing to 0x0 (hidden to
Playwright); give it explicit width/height instead.
The rewrite dropped 8 tests covering live behaviors (custom dialog/drawer
widths, styling passthrough, outside-click close, console-error guard,
initial closed state, single-open exclusivity). Restore them asserting
against the current DOM: dialog-class lands on the id-less panel wrapper
(dialog > div), drawer classes on the div[role=dialog] panel, triggers by
their showcase trigger ids. No waitForTimeout; state-based waits only.
toHaveClass(/card/) on .card-container matched its own locator class for
any variant. Assert real filled-variant semantics instead: no border and
no extra elevation, mirroring the outlined/elevated sibling assertions.
Four specs navigated with full http://localhost:8086 URLs, contradicting
the baseURL migration and breaking if the port moves. Use baseURL-
relative paths resolved from playwright.config.js instead.
The body > .absolute.z-50 branch of dropdownPanel ignored the name and
could strict-mode double-match when another select's panel is portaled.
Tag each dropdown with data-select-name at render so the portaled branch
resolves to the subject select's panel only.
The injected CSS shipped rules for top-1/2 and -translate-y-1/2 that
_getContainerClasses never emits, and the container classes kept inert
Tailwind-era names (pointer-events-none, transform) with no backing
utility. Remove both; positioned center variants keep working via the
left-1/2 + -translate-x-1/2 rules.
Resolve .eslintignore conflict taking develop's quarantine block; the
follow-up commit retires the quarantine now that the mobile specs are
lint-clean.
The three tests/e2e/mobile-*.spec.js specs are lint-clean and the theme
files landed clean via issue #13, so the .eslintignore quarantine block
is reduced to a comment-only retirement note. Pin the allowlist to the
empty set in eslint-quarantine.test.js and keep it as a growth guard:
any new exclusion fails there until the pin is updated in the same
change.
@bjinwright
bjinwright merged commit 155997d into develop Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant