Add Cypress E2E tests with fixture-based API mocking for UI regression protection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
30
cypress/fixtures/api/discover.json
Normal file
30
cypress/fixtures/api/discover.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"stats": {
|
||||
"cases": { "count": 150, "total": 200, "ratio": 0.75 },
|
||||
"traces": { "count": 45, "total": 60, "ratio": 0.75 },
|
||||
"task_instances": { "count": 1200, "total": 1500, "ratio": 0.8 },
|
||||
"tasks": { "count": 12, "total": 15, "ratio": 0.8 },
|
||||
"started_at": "2025-01-01T00:00:00Z",
|
||||
"completed_at": "2025-06-01T00:00:00Z",
|
||||
"case_duration": {
|
||||
"min": 3600,
|
||||
"max": 864000,
|
||||
"average": 172800,
|
||||
"median": 86400
|
||||
}
|
||||
},
|
||||
"graph": {
|
||||
"nodes": [
|
||||
{ "id": "start", "label": "Start", "type": "start" },
|
||||
{ "id": "task_a", "label": "Task A", "type": "task" },
|
||||
{ "id": "task_b", "label": "Task B", "type": "task" },
|
||||
{ "id": "end", "label": "End", "type": "end" }
|
||||
],
|
||||
"edges": [
|
||||
{ "source": "start", "target": "task_a", "count": 150 },
|
||||
{ "source": "task_a", "target": "task_b", "count": 120 },
|
||||
{ "source": "task_b", "target": "end", "count": 120 },
|
||||
{ "source": "task_a", "target": "end", "count": 30 }
|
||||
]
|
||||
}
|
||||
}
|
||||
42
cypress/fixtures/api/files.json
Normal file
42
cypress/fixtures/api/files.json
Normal file
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{
|
||||
"type": "log",
|
||||
"id": 1,
|
||||
"name": "sample-process.xes",
|
||||
"parent": null,
|
||||
"owner": { "username": "testadmin", "name": "Test Admin" },
|
||||
"updated_at": "2025-06-10T14:30:00Z",
|
||||
"accessed_at": "2025-06-12T09:00:00Z",
|
||||
"is_deleted": false
|
||||
},
|
||||
{
|
||||
"type": "filter",
|
||||
"id": 10,
|
||||
"name": "filtered-sample",
|
||||
"parent": { "type": "log", "id": 1, "name": "sample-process.xes" },
|
||||
"owner": { "username": "testadmin", "name": "Test Admin" },
|
||||
"updated_at": "2025-06-11T08:00:00Z",
|
||||
"accessed_at": "2025-06-12T10:00:00Z",
|
||||
"is_deleted": false
|
||||
},
|
||||
{
|
||||
"type": "log",
|
||||
"id": 2,
|
||||
"name": "production-log.csv",
|
||||
"parent": null,
|
||||
"owner": { "username": "user1", "name": "Alice Wang" },
|
||||
"updated_at": "2025-06-09T16:00:00Z",
|
||||
"accessed_at": null,
|
||||
"is_deleted": false
|
||||
},
|
||||
{
|
||||
"type": "log-check",
|
||||
"id": 100,
|
||||
"name": "conformance-check-1",
|
||||
"parent": { "type": "log", "id": 1, "name": "sample-process.xes" },
|
||||
"owner": { "username": "testadmin", "name": "Test Admin" },
|
||||
"updated_at": "2025-06-11T12:00:00Z",
|
||||
"accessed_at": null,
|
||||
"is_deleted": false
|
||||
}
|
||||
]
|
||||
9
cypress/fixtures/api/my-account.json
Normal file
9
cypress/fixtures/api/my-account.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"username": "testadmin",
|
||||
"name": "Test Admin",
|
||||
"is_sso": false,
|
||||
"created_at": "2025-01-15T10:00:00Z",
|
||||
"roles": [
|
||||
{ "code": "admin", "name": "Administrator" }
|
||||
]
|
||||
}
|
||||
18
cypress/fixtures/api/performance.json
Normal file
18
cypress/fixtures/api/performance.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"cycle_time": {
|
||||
"labels": ["Task A", "Task B"],
|
||||
"data": [7200, 3600]
|
||||
},
|
||||
"processing_time": {
|
||||
"labels": ["Task A", "Task B"],
|
||||
"data": [5400, 2700]
|
||||
},
|
||||
"waiting_time": {
|
||||
"labels": ["Task A → Task B", "Task B → End"],
|
||||
"data": [1800, 900]
|
||||
},
|
||||
"frequency": {
|
||||
"labels": ["Task A", "Task B"],
|
||||
"data": [150, 120]
|
||||
}
|
||||
}
|
||||
6
cypress/fixtures/api/token.json
Normal file
6
cypress/fixtures/api/token.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"access_token": "fake-access-token-for-testing",
|
||||
"token_type": "bearer",
|
||||
"expires_in": 3600,
|
||||
"refresh_token": "fake-refresh-token-for-testing"
|
||||
}
|
||||
16
cypress/fixtures/api/traces.json
Normal file
16
cypress/fixtures/api/traces.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"traces": [
|
||||
{
|
||||
"id": "trace-001",
|
||||
"case_id": "CASE-001",
|
||||
"count": 50,
|
||||
"activities": ["Task A", "Task B", "End"]
|
||||
},
|
||||
{
|
||||
"id": "trace-002",
|
||||
"case_id": "CASE-002",
|
||||
"count": 30,
|
||||
"activities": ["Task A", "End"]
|
||||
}
|
||||
]
|
||||
}
|
||||
26
cypress/fixtures/api/users.json
Normal file
26
cypress/fixtures/api/users.json
Normal file
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"username": "testadmin",
|
||||
"name": "Test Admin",
|
||||
"is_admin": true,
|
||||
"is_active": true,
|
||||
"is_sso": false,
|
||||
"has_data": true
|
||||
},
|
||||
{
|
||||
"username": "user1",
|
||||
"name": "Alice Wang",
|
||||
"is_admin": false,
|
||||
"is_active": true,
|
||||
"is_sso": false,
|
||||
"has_data": true
|
||||
},
|
||||
{
|
||||
"username": "user2",
|
||||
"name": "Bob Chen",
|
||||
"is_admin": false,
|
||||
"is_active": false,
|
||||
"is_sso": true,
|
||||
"has_data": false
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user