feat:playwright tests for tree-details page#1719
feat:playwright tests for tree-details page#1719WilsonNet wants to merge 2 commits intokernelci:mainfrom
Conversation
b56be97 to
9efbd26
Compare
dc5aadb to
9948da4
Compare
| data-test-id="breadcrumb-trees-link" | ||
| > | ||
| <FormattedMessage id="tree.details" /> | ||
| <FormattedMessage id="tree.path" /> |
There was a problem hiding this comment.
please remove this change
2677116 to
8623ee8
Compare
Add comprehensive e2e tests covering all requirements from issue kernelci#1664: - Filter drawer interaction (open/close/apply) - Filter selection via drawer (FAIL status filter) - Filter selection via summary cards (architecture links) - URL parameter validation after filter application Implement type-safe test ID system using Zod validation: - Add ColumnMetaSchema for validating table column metadata - Pass dataTestId through column meta instead of hardcoded checks - Add data-test-id props to TreeBreadcrumb and StatusChart components All components remain generic without business-specific logic. Closes kernelci#1664
Add two skills to guide AI coding agents working on the codebase: - typescript-type-safety: Enforces runtime validation with Zod or type guards instead of unsafe type assertions - react-generic-components: Ensures components remain generic and reusable without hardcoded business logic These skills provide guidelines, examples, and decision trees for maintaining code quality and consistency across the monorepo.
8623ee8 to
ff1381e
Compare
alanpeixinho
left a comment
There was a problem hiding this comment.
Had some trouble running locally. Most likelly, due to recent changes on the deployment.
It might be good if we rebase this PR to match current deployment.
| return ( | ||
| <BaseCard | ||
| title={title} | ||
| data-test-id="status-card" |
There was a problem hiding this comment.
are we using these ids in the base class?
There was a problem hiding this comment.
there is a docs on that, ids are used when selectors get too complicated
|
|
||
| ## Anti-Patterns to Avoid | ||
|
|
||
| ### ❌ Hardcoded Business Logic |
There was a problem hiding this comment.
We should check what is the best approach to add skills to the repo.
Any opinions @MarceloRobert @gustavobtflores ?
There was a problem hiding this comment.
And also, if possible, remote emojis.
| server: { | ||
| proxy: { | ||
| '/staging-api': { | ||
| target: 'https://staging.dashboard.kernelci.org:9000', |
There was a problem hiding this comment.
Wouldnt it be better to run against the local server for tests?
This way we can check if current modifications can break any e2e
There was a problem hiding this comment.
running a local server is cumbersome, a lot of times frontend developers don't wanna do that unless it is needed (including myself)
imagine you just wanna contribute by fix a spacing or a quick css change, and now you see yourself battling against docker files?
Summary
Adds end-to-end tests for tree details filter functionality, covering all requirements from issue #1664. Implements a type-safe test ID system using Zod validation while maintaining generic component architecture.
Additionally, adds AI agent skills to guide future code contributions with TypeScript and React best practices.
Changes
E2E Tests (Issue #1664)
New filter tests: 2 comprehensive tests for filter functionality
Test infrastructure improvements:
e2e/selectors/directory with common patternse2e/utils/(navigation, filters)AI Agent Skills (
.agents/skills/)Added two skills for maintaining code quality:
How to Test
Prerequisites
Start dev server with staging API proxy (in tmux or separate terminal):
cd dashboard pnpm run dev-remote-apiThe dev server should start on
http://localhost:5173with proxy configured for/staging-apiRun Tests
Run all tests:
cd dashboard pnpm run e2eRun only tree details tests:
Run only filter tests:
pnpm run e2e -- tree-details.spec.ts -g "adds filters"Run with UI mode (interactive):
Manual Testing
Navigate to http://localhost:5173/tree/android/android-mainline/7c5912a7c78d669e825093b8cbb57e6afaa88d11
Test filter drawer:
df.*FAIL)Test summary card filters:
Test breadcrumb navigation:
Technical Details
Closes #1664