Repository navigation
fix(e2e): repair Playwright E2E suite (#14) - #18
Merged
Merged
Conversation
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.
4 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repairs the Playwright E2E suite (issue #14) that was red on the
chore/drop-tailwind-cdnbaseline — ~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 insrc/, and brittle specs are only adjusted where the component itself was correct.Pass counts:
npx playwright testwent from 214 passed / 64 failed (QE baseline ateb16901) to 270 passed / 0 failed (exit 0).Clusters
:3000c76f47dlocalhost:3000URLs; specs usebaseURLe1ba2bawebServer(auto-startscripts/dev-server.js,reuseExistingServer) + README docse9402797273bc6dry2.cssvisual snapshots (light/dark + responsive)d73e71e94c2beasrc/10245995bb56aedry2.cssclasses (card,shadow)cb91c9dw-3 h-3)Notes
feature/issue-13-eslint-lint-clean(PR Make lint gate clean and add CI lint workflow #17). The base currently includes PR Make lint gate clean and add CI lint workflow #17's lint commits (and earlier merged work); the diff will narrow to just the 9 E2E commits above once Make lint gate clean and add CI lint workflow #17 merges first.src/(toast positioning, toggle IDs, countdown unit rebuild, component-builder input handling + SVG sizing), not papered over in tests.Test plan
npx playwright test-> 270 passed / 0 failed (exit 0)npm run test:unit-> baseline maintained (346 passing / 4 pending / 242 failing; pre-existingexpect is not definedintests/unit/components/*)npx eslintclean on all changed filestest.skipwithout a reason; no widened tolerances to hide bugsRefs #14 (do not close until verified on
develop).