Phase 12: cross-app visual/DOM/CSS/functional parity suite (feature)#323
Open
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Add a Playwright-based parity harness comparing the Angular and React apps: - playwright.config.ts with angular/react projects + desktop/mobile viewports - tests/visual-parity.spec.ts: full-page screenshots across pages/themes/viewports - tests/dom-parity.spec.ts: structural assertions - tests/style-parity.spec.ts: computed-style assertions - tests/functional-parity.spec.ts: behavioural assertions - tests/compare-screenshots.ts: pixelmatch diff + HTML report - npm scripts (test:visual:*, test:parity) and visual-parity CI workflow Shared fixtures/helpers mock the HN API so both apps render identical data. Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Author
Phase 12 status + note on the red
|
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
Adds Phase 12: Visual Parity Validation — a Playwright harness that measures whether the React migration renders identically to the original Angular app. The same specs run twice (a Playwright project per app, both pointed at deterministic mocked HN data) so any drift surfaces as a failing assertion in one app but not the other. A
pixelmatchscript then diffs the captured screenshots and emits an HTML report.This PR delivers the measuring harness, not migration fixes. It currently reports that DOM / CSS / functional parity is fully achieved, while pixel parity is not yet met on some pages (see "Current parity status").
What's included
playwright.config.ts—angular(:4200) andreact(:5173) projects; desktop1280×720and mobile (iPhone X)375×812.tests/fixtures.ts+tests/helpers.ts— mock everynode-hnapirequest with identical bytes for both apps; helpers for theme switching, settings, screenshot capture.tests/visual-parity.spec.ts(12b) — full-page screenshots across pages × 3 themes × 2 viewports.tests/dom-parity.spec.ts(12d) — structural assertions (30 feed items, comment subtree counts, settings inputs, theme class, …).tests/style-parity.spec.ts(12e) — computed-style assertions (header/wrapper bg per theme,.body-coverfixed overlay, title font-size follows settings, …).tests/functional-parity.spec.ts(12f) — behaviour (settings persistence, pagination, nav, comment collapse, external-linktarget/rel, mobile back button, dark-mode auto-detect).tests/compare-screenshots.ts(12c) — pixelmatch diff →screenshots/diffs/+screenshots/report.html; classifiesPASS <0.5%,WARN ≤2%,FAIL >2%; exits non-zero on any FAIL.test:visual:angular,test:visual:react,test:visual:compare,test:parity..github/workflows/visual-parity.yml(12h): checks out this branch +master(Angular), serves both, runsnpm run test:parity, uploadsscreenshots/+playwright-report/.Notes for reviewers
tsxinstead ofts-node(the plan's suggestion):pixelmatch@7is ESM-only andtsxruns it without loader flags.tsconfig.json, so they don't affect the existinglint/build.rgb(185, 43, 39)/rgb(38, 50, 56)/rgb(0, 0, 0)per theme); both apps must resolve to those exact values to pass.Current parity status
Running
npm run test:parityagainst both running apps:/news/1mobile: Angular2718pxvs React2122px), so full-page diffs accumulate a large vertical offset. A few desktop pages (/jobs/1, settings popup) sit just above the 2% threshold. Desktop heights otherwise match.Per spec 12h the workflow fails while any FAIL remains — this is the intended gate signalling the migration is not yet at full pixel parity. Closing those gaps is follow-up migration work, not part of this harness PR.
Link to Devin session: https://app.devin.ai/sessions/8415723ddaa94105b9b8f13eb80a2f84
Requested by: @lburgers
Devin Review
bad954c