You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,6 +283,54 @@ npm run cypress:open
283
283
284
284
For detailed testing instructions, see `web/cypress/CYPRESS_TESTING_GUIDE.md`
285
285
286
+
### Cypress Component Testing
287
+
288
+
#### Overview
289
+
290
+
Cypress component tests mount individual React components in isolation, without requiring a running OpenShift cluster. They are useful for testing component rendering, user interactions, and visual behavior with fast feedback.
Component tests mount individual React components in isolation using Cypress, without requiring a running OpenShift cluster. They provide fast feedback for rendering logic, props handling, and interactions.
101
+
102
+
### When to Use Component Tests vs E2E Tests
103
+
104
+
| Use Component Tests When | Use E2E Tests When |
105
+
|---|---|
106
+
| Testing rendering and visual output | Testing full user workflows |
107
+
| Verifying props and conditional display | Testing navigation between pages |
108
+
| Validating empty/error states | Testing API integration |
109
+
| Fast feedback during development | Testing cross-component interactions |
110
+
111
+
### Writing Component Tests
112
+
113
+
Component test files use the `.cy.tsx` extension and live in `cypress/component/`:
Copy file name to clipboardExpand all lines: web/cypress/README.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -352,20 +352,34 @@ export CYPRESS_SESSION=true
352
352
353
353
---
354
354
355
+
## Component Testing
356
+
357
+
Cypress component tests mount individual React components in isolation, without a running cluster. They provide fast feedback for testing rendering logic, props handling, and user interactions. See **[CYPRESS_TESTING_GUIDE.md](CYPRESS_TESTING_GUIDE.md)** for more guidance on how
358
+
to write and run the tests.
359
+
360
+
### Configuration
361
+
362
+
Component testing is configured in the `component` section of `web/cypress.config.ts`. It uses a standalone webpack config with `swc-loader` and a custom `mount` command (compatible with React 17) defined in `cypress/support/component.ts`.
0 commit comments