{ "test_date": "2026-06-22 19:25:57", "module": "仪表盘 (Dashboard)", "version": "0.1.0", "base_url": "http://localhost:3000", "summary": { "total": 20, "passed": 20, "failed": 0, "warnings": 0 }, "roles": { "admin": { "role": "admin", "url": "http://localhost:3000/admin/dashboard", "login_success": true, "page_status": "passed", "http_status": 200, "final_url": "http://localhost:3000/admin/dashboard", "checks": [ { "name": "页面内容非空", "passed": true, "detail": "内容长度 678338" }, { "name": "标题关键词匹配", "passed": true, "detail": "预期关键词: ['管理员', 'Admin', '仪表盘', 'Dashboard']" }, { "name": "统计卡片数量 (预期 4)", "passed": true, "detail": "实际: 16" }, { "name": "快捷操作链接 (预期 >= 7)", "passed": true, "detail": "实际: 14" }, { "name": "最近用户表格存在", "passed": true, "detail": "表格存在: True" }, { "name": "图表或空状态 (预期图表 2)", "passed": true, "detail": "图表: 0, 空状态: True" } ], "console_errors": [], "screenshots": [ "dashboard_admin.png" ], "errors": [], "warnings": [] }, "teacher": { "role": "teacher", "url": "http://localhost:3000/teacher/dashboard", "login_success": true, "page_status": "passed", "http_status": 200, "final_url": "http://localhost:3000/teacher/dashboard", "checks": [ { "name": "页面内容非空", "passed": true, "detail": "内容长度 662101" }, { "name": "标题关键词匹配", "passed": true, "detail": "预期关键词: ['教师', 'Teacher', '仪表盘', 'Dashboard']" }, { "name": "统计卡片数量 (预期 4)", "passed": true, "detail": "实际: 5" }, { "name": "待办卡片存在", "passed": true, "detail": "待办区域: 8" }, { "name": "快捷链接存在: /teacher/homework/submissions", "passed": true, "detail": "" }, { "name": "快捷链接存在: /teacher/attendance/sheet", "passed": true, "detail": "" }, { "name": "快捷链接存在: /teacher/homework/assignments", "passed": true, "detail": "" } ], "console_errors": [], "screenshots": [ "dashboard_teacher.png" ], "errors": [], "warnings": [] }, "student": { "role": "student", "url": "http://localhost:3000/student/dashboard", "login_success": true, "page_status": "passed", "http_status": 200, "final_url": "http://localhost:3000/student/dashboard", "checks": [ { "name": "页面内容非空", "passed": true, "detail": "内容长度 520955" }, { "name": "标题关键词匹配", "passed": true, "detail": "预期关键词: ['学生', 'Student', '仪表盘', 'Dashboard']" }, { "name": "统计卡片数量 (预期 5)", "passed": true, "detail": "实际: 6" }, { "name": "今日课表卡片", "passed": true, "detail": "" }, { "name": "作业卡片", "passed": true, "detail": "" } ], "console_errors": [], "screenshots": [ "dashboard_student.png" ], "errors": [], "warnings": [] }, "parent": { "role": "parent", "url": "http://localhost:3000/parent/dashboard", "login_success": true, "page_status": "passed", "http_status": 200, "final_url": "http://localhost:3000/parent/dashboard", "checks": [ { "name": "页面内容非空", "passed": true, "detail": "内容长度 492448" }, { "name": "标题关键词匹配", "passed": true, "detail": "预期关键词: ['家长', 'Parent', '仪表盘', 'Dashboard']" }, { "name": "快捷入口链接: /parent/grades", "passed": true, "detail": "" }, { "name": "快捷入口链接: /parent/attendance", "passed": true, "detail": "" }, { "name": "快捷入口链接: /announcements", "passed": true, "detail": "" }, { "name": "快捷入口链接: /parent/leave", "passed": true, "detail": "" }, { "name": "孩子卡片区域", "passed": true, "detail": "检测到孩子相关内容: True" } ], "console_errors": [], "screenshots": [ "dashboard_parent.png" ], "errors": [], "warnings": [] } }, "redirect_tests": [ { "role": "admin", "url": "http://localhost:3000/dashboard", "expected_redirect": "/admin/dashboard", "final_url": "http://localhost:3000/admin/dashboard", "passed": true, "error": null }, { "role": "teacher", "url": "http://localhost:3000/dashboard", "expected_redirect": "/teacher/dashboard", "final_url": "http://localhost:3000/teacher/dashboard", "passed": true, "error": null }, { "role": "student", "url": "http://localhost:3000/dashboard", "expected_redirect": "/student/dashboard", "final_url": "http://localhost:3000/student/dashboard", "passed": true, "error": null }, { "role": "parent", "url": "http://localhost:3000/dashboard", "expected_redirect": "/parent/dashboard", "final_url": "http://localhost:3000/parent/dashboard", "passed": true, "error": null } ], "cross_role_tests": [ { "role": "admin", "forbidden_route": "/teacher/dashboard", "final_url": "http://localhost:3000/admin/dashboard?from=%2Fteacher%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /admin/dashboard(拒绝访问)" }, { "role": "admin", "forbidden_route": "/student/dashboard", "final_url": "http://localhost:3000/admin/dashboard?from=%2Fstudent%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /admin/dashboard(拒绝访问)" }, { "role": "admin", "forbidden_route": "/parent/dashboard", "final_url": "http://localhost:3000/admin/dashboard?from=%2Fparent%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /admin/dashboard(拒绝访问)" }, { "role": "teacher", "forbidden_route": "/admin/dashboard", "final_url": "http://localhost:3000/teacher/dashboard?from=%2Fadmin%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /teacher/dashboard(拒绝访问)" }, { "role": "teacher", "forbidden_route": "/student/dashboard", "final_url": "http://localhost:3000/teacher/dashboard?from=%2Fstudent%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /teacher/dashboard(拒绝访问)" }, { "role": "teacher", "forbidden_route": "/parent/dashboard", "final_url": "http://localhost:3000/teacher/dashboard?from=%2Fparent%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /teacher/dashboard(拒绝访问)" }, { "role": "student", "forbidden_route": "/admin/dashboard", "final_url": "http://localhost:3000/student/dashboard?from=%2Fadmin%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /student/dashboard(拒绝访问)" }, { "role": "student", "forbidden_route": "/teacher/dashboard", "final_url": "http://localhost:3000/student/dashboard?from=%2Fteacher%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /student/dashboard(拒绝访问)" }, { "role": "student", "forbidden_route": "/parent/dashboard", "final_url": "http://localhost:3000/student/dashboard?from=%2Fparent%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /student/dashboard(拒绝访问)" }, { "role": "parent", "forbidden_route": "/admin/dashboard", "final_url": "http://localhost:3000/parent/dashboard?from=%2Fadmin%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /parent/dashboard(拒绝访问)" }, { "role": "parent", "forbidden_route": "/teacher/dashboard", "final_url": "http://localhost:3000/parent/dashboard?from=%2Fteacher%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /parent/dashboard(拒绝访问)" }, { "role": "parent", "forbidden_route": "/student/dashboard", "final_url": "http://localhost:3000/parent/dashboard?from=%2Fstudent%2Fdashboard&reason=forbidden", "passed": true, "error": "重定向回 /parent/dashboard(拒绝访问)" } ], "console_errors_global": [] }