Commit 60e7234
committed
feat(Cypress): add Prometheus query mocking system for incident scenarios
- Implement Prometheus query_range API interception for mocking the
incidents page data
- Add complete YAML-based incident fixture system with JSON Schema validation
- Support complex incident timelines with severity changes and resolved/ongoing states
- Include 5 predefined incident scenario fixtures
- Add custom Cypress commands: cy.mockIncidents() and cy.mockIncidentFixture()
- Support both YAML and JSON fixture formats
- Add timezone configuration via CYPRESS_TIMEZONE environment variable
(necessary for correct timeline mocking)
- Implement schema validation with CLI tool for fixture validation
- Add Cursor commands to generate the scenarios in .cursor/commands/
- Add example test demonstrating different mocking approaches
- Integrate mocking system into existing incidents test (01.incidents.cy.ts)
- Add dependencies: ajv, js-yaml, @types/ajv, @types/js-yaml
- Fix Cypress fixtures folder path from 'fixtures' to 'cypress/fixtures'1 parent 1084dd6 commit 60e7234
File tree
3 files changed
+16
-17
lines changed- web/cypress/support/incidents_prometheus_query_mocks
3 files changed
+16
-17
lines changedLines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
Lines changed: 15 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
56 | 55 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
63 | 62 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
0 commit comments