Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ website/ # demo site (Vite + TanStack Router)
- Browser tests use `vite-plus/test/browser` + Playwright. `test/setupBrowser.ts` configures `page.render()` via `vitest-browser-react` and registers custom locators via `locators.extend()` — prefer `page.getGrid()`, `page.getCell({ name })`, `page.getRow()`, `page.getHeaderCell()`, `page.getActiveCell()`, etc. over raw `page.getByRole()`.
- Test helpers in `test/browser/utils.tsx`: `setup()`, `getRowWithCell()`, `getCellsAtRowIndex()`, `validateCellPosition()`, `scrollGrid()`, `safeTab()`, `testCount()`, `testRowCount()`.
- `test/failOnConsole.ts` fails tests on unexpected console warnings/errors.
- Firefox and WebKit retry failed tests once (`retry` in `vite.config.ts`), and `--retry=0` doesn't override it. Add `--reporter=verbose` to see tests that passed on retry, marked `(retry x1)`.
- **Never run visual regression tests** — screenshots are environment-dependent, so visual regression tests must run in CI only.

## Tooling
Expand Down
10 changes: 8 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ async function getTscPath(): Promise<string> {

const actionTimeout = 2000;
const viewport = { width: 1920, height: 1080 } as const;
// Firefox and WebKit tests are flakier than Chromium tests, so they retry failed tests once.
// Chromium doesn't retry, so flakes caused by the grid itself still fail there.
// On GitHub Actions, the job summary lists tests that passed on retry.
const retry = 1;
const playwrightOptions: PlaywrightProviderOptions = {
actionTimeout,
contextOptions: {
Expand Down Expand Up @@ -299,11 +303,13 @@ export default defineConfig({
}
}),
// TODO: remove when FF tests are stable
fileParallelism: false
fileParallelism: false,
retry
},
{
browser: 'webkit',
provider: playwright(playwrightOptions)
provider: playwright(playwrightOptions),
retry
}
]
},
Expand Down
Loading