Repository navigation
Fixes #37219: Vitest browser-mode UI integration tests (Pagination migration, marked) + CI - #35623
Conversation
…lure vitest-browser-react unmounts in the next test's beforeEach, so the global afterEach reset handlers and the URL under a still-mounted page, which then refetched and got wrong-shaped responses (unhandled paging/permission errors). Also write lcov when a test fails so one flake can't drop Sonar coverage.
…nd stability runs Runs the browser suite with istanbul coverage and posts a Jest-style coverage and JUnit comment, plus five shuffled no-retry runs whose failures are summarized in a second comment. Drops the duplicate patch file.
UI browser test coverage |
…s on failure main now calls /metadata/types/workflows/approvalEnforcedEntityTypes and /changeRequests from entity pages, which the strict unmocked-API check caught. The workflow now records wall time and uploads screenshots even when tests fail.
# Conflicts: # openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Pagination.spec.ts # openmetadata-ui/src/main/resources/ui/yarn.lock
main removed it with the antd Form/Select/Input migration (#35509); the app no longer mounts it.
# Conflicts: # openmetadata-ui/src/main/resources/ui/yarn.lock
The shuffled no-retry runs showed the suite stable; the workflow now runs the browser tests once, with coverage, on UI and core-component changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…owser The 35 Pagination E2E tests covered by browser tests keep running, tagged with their replacement, until the browser tests are validated and PaginationIT walks cursors for every listed entity type. Records the layering rule as a decision. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Skips the coverage comment on fork PRs and lets it fail without failing the job; formats three browser-test files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # openmetadata-ui/src/main/resources/ui/package.json # openmetadata-ui/src/main/resources/ui/yarn.lock
A path-scoped rule for browser tests and Playwright specs: pick the layer (Jest, browser test, Java IT, Playwright journey), write a browser test with the shared fixtures, and tag a moved Playwright test instead of deleting it. The Playwright rule and test-enforcement skill point to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…izes Main added GET /domains/styles and /ontologyConcepts/boundTo calls to every entity page, and moved list pages to 15/25/50 (#35288); the browser tests now answer both calls and read PAGE_SIZE_BASE. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # openmetadata-ui/src/main/resources/ui/package.json # openmetadata-ui/src/main/resources/ui/yarn.lock
…ar path Search hits now come back in a different order from the list, and the contract asserts the visible rows after search, Next and reload, so a page that sends the right request but keeps showing old rows fails. Sonar never receives browser coverage yet, so its lcov path is dropped. The agent rule names only helpers that exist on this branch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…contract settle() slept 300 ms. The contract now waits until MSW has nothing in flight and no new request for a short quiet window, which is what a request count needs to be final; render waits poll for the row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
harsh-vador
left a comment
There was a problem hiding this comment.
Thanks for putting this together. Strict unmocked-API failures and unmounting before handlers reset are both good calls, and the spec diff is only tags plus reflow, which I checked with whitespace ignored.
Main things before this goes in:
- Some of the description and docs don't match the diff: the Sonar lcov, the coverage comment, the workflow trigger, the test counts, and the a11y fix.
- The
test.failspins on Data Models and Stored Procedures, combined with the@migrated-browsertags, would leave those flows without coverage once the E2E tests are deleted. - The ADR is marked Accepted ahead of team sign-off.
The rest are smaller suggestions inline.
- Data Models and Stored Procedures: their browser tests are pinned failing by a product bug (#38295), so their Playwright tests stay untagged; double fetch filed as #38296. Migration doc counts and rows updated. - Decision record is Proposed until the team signs off. - No Sonar claims (it does not read browser coverage yet); no unused JUnit. - The workflow also runs on setup-action changes; the setup action caches Chromium and the ANTLR CLI. - setup.ts resets the app-wide zustand stores between tests. - networkIdle counts /api requests only and notes its quiet-window limit. - Screenshot comparison runs on Linux only (its baseline's platform). - Contract: two-page assumption checked, empty-record guard, isListPage shared, search mock scope documented; msw resolutions dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Review ✅ Approved 🟡 Medium risk 5 closed / 5 findingsThe new Chromium browser-test workflow adds a separate UI CI job and coverage reporting, which could disrupt PR feedback if setup or reporting fails. Adds Vitest Browser Mode and MSW UI integration tests for pagination, a layering decision record, and a separate browser-test CI workflow. Resolved this session: the stability run wall-time and count issue, the missing real-server cursor paging coverage, the missing decision record in docs/decisions/, and the failure-screenshot upload skipped when the comment step fails. No open findings remain. ✅ 5 closed✅ Bug: Stability run loses wall time and counts whenever a test fails
✅ Quality: E2E pagination deleted while real-server cursor paging stays untested
✅ Quality: Test-layering decision is not in docs/decisions/
✅ Bug: Comment step failure skips failure-screenshot upload; forks fail
Closed: Quality: Browser-test rule tells agents to use helpers that don't exist in tree
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Base of #36198. This adds UI integration tests in Vitest Browser Mode, with MSW mocking every
/apicall, to take over page-behaviour checks from heavy Playwright E2E specs. The layering rule is proposed inADR:2026-10-28-page-behaviour-is-tested-in-vitest-browser-mode-and-e2e-tests-leave-by-marking(status Proposed until the team signs off).What's here:
src/test/browser/(renderWithApp/renderApp, typed fixtures,paginationContract.ts). Any unmocked/api/*call fails the test, so no test can pass against a request that failed silently.playwright/e2e/Features/Pagination.spec.ts, 31 are covered by 22*.browser.test.tsxfiles (70 tests plus 4test.failsthat pin real bugs). The Playwright tests are not deleted: each covered one is tagged@migrated-browserwith its replacement (playwright/constant/migration.ts) and keeps running until the browser tests are validated andPaginationITcovers every list endpoint. The 8 untagged ones: 2 real-server smoke tests, 2 Topic schema fields tests added after this migration, and 4 Data Models / Stored Procedures tests whose browser tests are pinned failing by Data Models and Stored Procedures tabs reset to page 1 after Next #38295. The mapping is insrc/test/browser/PAGINATION_MIGRATION.md.setup.tsunmounts before resetting MSW handlers (vitest-browser-reactonly unmounts in the next test'sbeforeEach, so a still-mounted page refetched against reset handlers), then resets the URL, localStorage and the app-wide zustand stores. Waits use conditions (network.ts'snetworkIdle), never fixed sleeps..claude/rules/frontend-browser-tests.mdauto-loads on browser tests and Playwright specs. It says which layer a check belongs in (Jest, browser test, Java IT or Playwright journey), how to write a browser test with the shared fixtures, and how to tag a moved Playwright test instead of deleting it.AGENTS.md.frontend-playwright.mdand thetest-enforcementskill point to it..github/workflows/ui-browser-tests.yml(new file; no existing workflow is changed):ubuntu-24.04only when the UI, the core components, or the workflow and its setup action change;workflow_runcommenter;Type of change:
High-level design:
src/test/browser/README.md.Pagination.spec.tscosts 274–495 s of CI worker time, plus the shared stack, build and fixture pipeline. Locally, on a heavily loaded M1 Pro (load 35–60 on 8 cores), the browser suite runs in ~2m14s without coverage, with no backend at all. This PR measures it on a CI runner.PaginationITis called only for tables. It should cover every list endpoint, so the server side of what moved here stays tested against a real DB.Tests:
Use cases covered
Pagination across 22 list pages: Next/Previous with cursors and URL sync, deep links, reload, page-size change, search resetting to page 1, empty states, the deleted toggle, the Files ↔ Spreadsheets tab reset, client-side paging, and a visual snapshot of the schema table.
Unit tests
N/A: the change is test infrastructure. Jest is unaffected (
*.browser.test.tsxis excluded from Jest).Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Pagination.spec.ts: 35 tests are tagged@migrated-browser, and the 2 real-server smoke tests are untagged.Manual testing performed
On macOS (M1 Pro):
yarn test:ui:run --maxWorkers=3: 70 passed + 4 expected fail.yarn test:ui:coverage: the coverage report is written even when a test fails.testTimeouts, a different test each run.UI screen recording:
Not applicable: test and CI infrastructure only, no product UI change. (The
ObservabilityAlertsTablerow-header fix the migration found landed separately on main.)Checklist:
Fixes <issue-number>: <short explanation>.Fixes #<issue-number>: Fixes Vitest browser-mode + MSW setup for UI integration tests, with CI #37219.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with a non-blocking concern about ANTLR download reliability.Findings
Summary
Adds Vitest browser tests with MSW, shared pagination checks, migration markers, and a separate CI workflow.
Reviews (7) · Last reviewed commit: "test(ui): address review on the browser-..." · Reviewed by Greptile