pulse-dashboard 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +10 -9
- package/.next/fallback-build-manifest.json +3 -2
- package/.next/images-manifest.json +2 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +13 -13
- package/.next/required-server-files.json +209 -40
- package/.next/routes-manifest.json +1 -0
- package/.next/server/app/_global-error/page/build-manifest.json +7 -7
- package/.next/server/app/_global-error/page.js +8 -9
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +2 -1
- package/.next/server/app/_global-error.html +1 -2
- package/.next/server/app/_global-error.rsc +11 -9
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_global-error.segments/_full.segment.rsc +11 -9
- package/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -3
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +7 -7
- package/.next/server/app/_not-found/page.js +11 -12
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +2 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +19 -16
- package/.next/server/app/_not-found.segments/_full.segment.rsc +19 -16
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/analyze-test/route/build-manifest.json +1 -3
- package/.next/server/app/api/analyze-test/route.js +3 -3
- package/.next/server/app/api/analyze-test/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze-test/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/assets/[...slug]/route/build-manifest.json +1 -3
- package/.next/server/app/api/assets/[...slug]/route.js +4 -4
- package/.next/server/app/api/assets/[...slug]/route.js.nft.json +1 -1
- package/.next/server/app/api/assets/[...slug]/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/current-run/route/build-manifest.json +1 -3
- package/.next/server/app/api/current-run/route.js +3 -3
- package/.next/server/app/api/current-run/route.js.nft.json +1 -1
- package/.next/server/app/api/current-run/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/historical-trends/route/build-manifest.json +1 -3
- package/.next/server/app/api/historical-trends/route.js +4 -3
- package/.next/server/app/api/historical-trends/route.js.nft.json +1 -1
- package/.next/server/app/api/historical-trends/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/report-config/route/build-manifest.json +1 -3
- package/.next/server/app/api/report-config/route.js +3 -3
- package/.next/server/app/api/report-config/route.js.nft.json +1 -1
- package/.next/server/app/api/report-config/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/reports/[filename]/route/build-manifest.json +1 -3
- package/.next/server/app/api/reports/[filename]/route.js +3 -3
- package/.next/server/app/api/reports/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/reports/[filename]/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/run-command/route/build-manifest.json +1 -3
- package/.next/server/app/api/run-command/route.js +3 -3
- package/.next/server/app/api/run-command/route.js.nft.json +1 -1
- package/.next/server/app/api/run-command/route_client-reference-manifest.js +2 -1
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +14 -12
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +14 -12
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +5 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page/build-manifest.json +7 -7
- package/.next/server/app/page/react-loadable-manifest.json +1 -2
- package/.next/server/app/page/server-reference-manifest.json +1 -4
- package/.next/server/app/page.js +12 -14
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +2 -1
- package/.next/server/app/test/[testId]/page/build-manifest.json +7 -7
- package/.next/server/app/test/[testId]/page/server-reference-manifest.json +1 -4
- package/.next/server/app/test/[testId]/page.js +12 -14
- package/.next/server/app/test/[testId]/page.js.nft.json +1 -1
- package/.next/server/app/test/[testId]/page_client-reference-manifest.js +2 -1
- package/.next/server/chunks/[externals]__0m-sipc._.js +3 -0
- package/.next/server/chunks/{[externals]__f52e4eb0._.js → [externals]__124ywe.._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0126wt3._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__016m3l7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0bgp.n9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jh2b8b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0k26p~k._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0nglzhr._.js +13 -0
- package/.next/server/chunks/[root-of-the-server]__0x8r-.9._.js +3 -0
- package/.next/server/chunks/[turbopack]_runtime.js +168 -60
- package/.next/server/chunks/{_next-internal_server_app_api_analyze-test_route_actions_e71f7d12.js → _next-internal_server_app_api_analyze-test_route_actions_0.saobd.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_assets_[___slug]_route_actions_a10bfa98.js → _next-internal_server_app_api_assets_[___slug]_route_actions_0rqs88g.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_current-run_route_actions_ed7eca66.js → _next-internal_server_app_api_current-run_route_actions_10w286-.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_historical-trends_route_actions_ab165c16.js → _next-internal_server_app_api_historical-trends_route_actions_0tfs591.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_report-config_route_actions_7f74a29f.js → _next-internal_server_app_api_report-config_route_actions_0lzyt8k.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_reports_[filename]_route_actions_54bb3323.js → _next-internal_server_app_api_reports_[filename]_route_actions_0emat-g.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_run-command_route_actions_b3861930.js → _next-internal_server_app_api_run-command_route_actions_0uxr5bx.js} +1 -1
- package/.next/server/chunks/node_modules_next_dist_06kebd7._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0.zquoa._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__05ct2gl._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0eqd2za._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0jmj6g1._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0mgphg.._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0uyy96m._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0v5vgt4._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0we7bel._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__10xgshr._.js +33 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +168 -60
- package/.next/server/chunks/ssr/_0dvn4a6._.js +6 -0
- package/.next/server/chunks/ssr/_0jkkbka._.js +7 -0
- package/.next/server/chunks/ssr/_0nfs~1l._.js +5 -0
- package/.next/server/chunks/ssr/_0pa59oo._.js +3 -0
- package/.next/server/chunks/ssr/_11mmbg~._.js +5 -0
- package/.next/server/chunks/ssr/{_next-internal_server_app__global-error_page_actions_75761787.js → _next-internal_server_app__global-error_page_actions_0k77kol.js} +1 -1
- package/.next/server/chunks/ssr/{_next-internal_server_app__not-found_page_actions_554ec2bf.js → _next-internal_server_app__not-found_page_actions_0eq97pa.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_09w7yel._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_0aem7sr._.js +19 -0
- package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_11~q6fv._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +6 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_9774470f._.js → node_modules_next_dist_client_components_0inhx6q._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_45780354.js → node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_global-error_ece394eb.js → node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_15817684.js → node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_01ycdec.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0bj8dkg.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0cvrgh7.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0rc3ul_.js +4 -0
- package/.next/server/chunks/ssr/{src_ce5be59b._.js → src_0udngk~._.js} +3 -3
- package/.next/server/chunks/ssr/src_components_ui_toaster_tsx_0cainpy._.js +3 -0
- package/.next/server/middleware-build-manifest.js +12 -12
- package/.next/server/prefetch-hints.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +3 -9
- package/.next/static/RgESZIprcZznm98mxUv-O/_clientMiddlewareManifest.js +1 -0
- package/.next/static/chunks/00g8rbqi0h8lk.js +1 -0
- package/.next/static/chunks/01xlw8hd842-c.js +1 -0
- package/.next/static/chunks/04j4.hz_cv-pf.js +1 -0
- package/.next/static/chunks/07uz2g0_38qia.js +4 -0
- package/.next/static/chunks/0b8rufmwi4-6v.js +1 -0
- package/.next/static/chunks/0fwam_-pec8pg.js +2 -0
- package/.next/static/chunks/0gsquco4lyvb4.js +1 -0
- package/.next/static/chunks/0h4bq73pogmtb.js +1 -0
- package/.next/static/chunks/0imfvrlr~2q89.js +31 -0
- package/.next/static/chunks/0m5-x6u~hwh1m.js +1 -0
- package/.next/static/chunks/0mzwfspg4216r.js +1 -0
- package/.next/static/chunks/0p.r891xm97do.js +1 -0
- package/.next/static/chunks/0w0gkm45qpujx.js +5 -0
- package/.next/static/chunks/0~ariudu4in54.js +1 -0
- package/.next/static/chunks/13mqc.b~s2gjo.js +1 -0
- package/.next/static/chunks/14rqub-mhf1rm.css +1 -0
- package/.next/static/chunks/15y_~8vy363bg.js +3 -0
- package/.next/static/chunks/16navnbzwbp36.js +1 -0
- package/.next/static/chunks/17~ltcjkf11xe.js +3 -0
- package/.next/static/chunks/1860zsbcg5z1o.js +1 -0
- package/.next/static/chunks/turbopack-11rw6yhug.je0.js +1 -0
- package/LICENSE +21 -202
- package/README.md +22 -1
- package/bin/pulse-dashboard.js +49 -3
- package/dist/app/actions.d.ts +3 -1
- package/dist/app/actions.d.ts.map +1 -1
- package/dist/app/actions.js +51 -13
- package/dist/app/actions.js.map +1 -1
- package/dist/components/pulse-dashboard/DashboardOverviewCharts.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/DashboardOverviewCharts.jsx +530 -235
- package/dist/components/pulse-dashboard/DashboardOverviewCharts.jsx.map +1 -1
- package/dist/components/pulse-dashboard/FailureCategorizationView.d.ts +1 -2
- package/dist/components/pulse-dashboard/FailureCategorizationView.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/FailureCategorizationView.jsx +168 -51
- package/dist/components/pulse-dashboard/FailureCategorizationView.jsx.map +1 -1
- package/dist/components/pulse-dashboard/FlakyTestsWidget.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/FlakyTestsWidget.jsx +90 -75
- package/dist/components/pulse-dashboard/FlakyTestsWidget.jsx.map +1 -1
- package/dist/components/pulse-dashboard/LiveTestResults.d.ts +1 -1
- package/dist/components/pulse-dashboard/LiveTestResults.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/LiveTestResults.jsx +73 -36
- package/dist/components/pulse-dashboard/LiveTestResults.jsx.map +1 -1
- package/dist/components/pulse-dashboard/PulseCommandView.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/PulseCommandView.jsx +14 -4
- package/dist/components/pulse-dashboard/PulseCommandView.jsx.map +1 -1
- package/dist/components/pulse-dashboard/PulseDashboard.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/PulseDashboard.jsx +1 -2
- package/dist/components/pulse-dashboard/PulseDashboard.jsx.map +1 -1
- package/dist/components/pulse-dashboard/SettingsView.jsx +2 -2
- package/dist/components/pulse-dashboard/SettingsView.jsx.map +1 -1
- package/dist/components/pulse-dashboard/SummaryMetrics.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/SummaryMetrics.jsx +75 -19
- package/dist/components/pulse-dashboard/SummaryMetrics.jsx.map +1 -1
- package/dist/components/pulse-dashboard/SystemInformationWidget.d.ts +3 -3
- package/dist/components/pulse-dashboard/SystemInformationWidget.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/SystemInformationWidget.jsx +125 -41
- package/dist/components/pulse-dashboard/SystemInformationWidget.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TestDetailsClientPage.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/TestDetailsClientPage.jsx +689 -536
- package/dist/components/pulse-dashboard/TestDetailsClientPage.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TestItem.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/TestItem.jsx +18 -8
- package/dist/components/pulse-dashboard/TestItem.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TestStepItemRecursive.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/TestStepItemRecursive.jsx +3 -3
- package/dist/components/pulse-dashboard/TestStepItemRecursive.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TrendAnalysis.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/TrendAnalysis.jsx +53 -17
- package/dist/components/pulse-dashboard/TrendAnalysis.jsx.map +1 -1
- package/dist/components/ui/alert.jsx +1 -1
- package/dist/components/ui/alert.jsx.map +1 -1
- package/dist/components/ui/button.jsx +3 -3
- package/dist/components/ui/card.jsx +1 -1
- package/dist/components/ui/card.jsx.map +1 -1
- package/dist/components/ui/tabs.jsx +2 -2
- package/dist/components/ui/tabs.jsx.map +1 -1
- package/dist/lib/testUtils.d.ts +12 -0
- package/dist/lib/testUtils.d.ts.map +1 -0
- package/dist/lib/testUtils.js +37 -0
- package/dist/lib/testUtils.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/types/playwright.d.ts +7 -3
- package/dist/types/playwright.d.ts.map +1 -1
- package/package.json +13 -8
- package/.next/server/chunks/[root-of-the-server]__06c6346e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__42738744._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7113a113._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__71e0e3b9._.js +0 -21
- package/.next/server/chunks/[root-of-the-server]__74bb0547._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__9f88b7b7._.js +0 -4
- package/.next/server/chunks/[root-of-the-server]__c159e29b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__d7fdaf5c._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__15600e29._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__22ecdfea._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__4a382b8f._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__71dd9d42._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__77c90d39._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__84313e76._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__aed7e4d8._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__b3b1f5eb._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__b9356576._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__c507bbfe._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__c829c7d1._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__efd22fba._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__f682065b._.js +0 -3
- package/.next/server/chunks/ssr/_178fc551._.js +0 -5
- package/.next/server/chunks/ssr/_3635f42f._.js +0 -3
- package/.next/server/chunks/ssr/_3f2f13a0._.js +0 -5
- package/.next/server/chunks/ssr/_42495f68._.js +0 -7
- package/.next/server/chunks/ssr/_7bd96dfb._.js +0 -4
- package/.next/server/chunks/ssr/_97aa43fe._.js +0 -6
- package/.next/server/chunks/ssr/_c1309523._.js +0 -4
- package/.next/server/chunks/ssr/node_modules_256e9ddd._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_entities_lib_maps_6c3ea140._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js +0 -4
- package/.next/server/chunks/ssr/node_modules_next_dist_174ae28d._.js +0 -10
- package/.next/server/chunks/ssr/node_modules_next_dist_4b9a0874._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_65a7265e.js +0 -4
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_eedfc1fd._.js +0 -6
- package/.next/server/chunks/ssr/src_components_ui_toaster_tsx_475f3ca1._.js +0 -3
- package/.next/static/chunks/0f33d151720dd9be.js +0 -1
- package/.next/static/chunks/42ac08e824892d98.js +0 -3
- package/.next/static/chunks/4aba24f188aab88f.js +0 -1
- package/.next/static/chunks/5413d7a3986e863a.css +0 -1
- package/.next/static/chunks/5ccfb5a289153a0c.js +0 -1
- package/.next/static/chunks/5cedbe3d28acc407.js +0 -4
- package/.next/static/chunks/7ed4bd6bf5216809.js +0 -1
- package/.next/static/chunks/836027b6298d8236.js +0 -5
- package/.next/static/chunks/90e8775562b10304.js +0 -1
- package/.next/static/chunks/952cc6d18d6c0e81.js +0 -1
- package/.next/static/chunks/9ac02f87b0542bfe.js +0 -1
- package/.next/static/chunks/b451c069ec473146.js +0 -1
- package/.next/static/chunks/bb0500a106848313.js +0 -1
- package/.next/static/chunks/c9bfc6dc89d94445.js +0 -2
- package/.next/static/chunks/cb4802d54f2ae8f7.js +0 -3
- package/.next/static/chunks/cdad36853a3d0cf6.js +0 -1
- package/.next/static/chunks/d4b4a1ad90e2acdb.js +0 -1
- package/.next/static/chunks/e82964c236ab8171.js +0 -1
- package/.next/static/chunks/ec55f44e251b8481.js +0 -1
- package/.next/static/chunks/fc9b3392d13f74a4.js +0 -1
- package/.next/static/chunks/ff1a16fafef87110.js +0 -1
- package/.next/static/chunks/turbopack-4063ae190c9edad5.js +0 -4
- package/.next/static/h7udJfXH3pEIZIFFB4Jiu/_clientMiddlewareManifest.json +0 -1
- /package/.next/static/{h7udJfXH3pEIZIFFB4Jiu → RgESZIprcZznm98mxUv-O}/_buildManifest.js +0 -0
- /package/.next/static/{h7udJfXH3pEIZIFFB4Jiu → RgESZIprcZznm98mxUv-O}/_ssgManifest.js +0 -0
- /package/.next/static/chunks/{a6dad97d9634a72d.js → 03~yq9q893hmn.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRouter } from "next/navigation";
|
|
3
3
|
import { useTestData } from "@/hooks/useTestData";
|
|
4
|
+
import { getEffectiveTestStatus } from "@/lib/testUtils";
|
|
4
5
|
import { Card, CardContent, CardHeader, CardTitle, CardDescription, } from "@/components/ui/card";
|
|
5
6
|
import { Button } from "@/components/ui/button";
|
|
6
7
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select";
|
|
@@ -24,6 +25,8 @@ const StatusDot = (props) => {
|
|
|
24
25
|
let color = "hsl(var(--muted-foreground))"; // Default color
|
|
25
26
|
if (payload.status === "passed")
|
|
26
27
|
color = "hsl(var(--chart-3))";
|
|
28
|
+
else if (payload.status === "flaky")
|
|
29
|
+
color = "hsl(var(--flaky))";
|
|
27
30
|
else if (payload.status === "failed" || payload.status === "timedOut")
|
|
28
31
|
color = "hsl(var(--destructive))";
|
|
29
32
|
else if (payload.status === "skipped")
|
|
@@ -33,15 +36,17 @@ const StatusDot = (props) => {
|
|
|
33
36
|
const HistoryTooltip = ({ active, payload, label }) => {
|
|
34
37
|
if (active && payload && payload.length) {
|
|
35
38
|
const data = payload[0].payload;
|
|
36
|
-
return (<div className="bg-card p-3 border border-border rounded-
|
|
39
|
+
return (<div className="bg-card p-3 border border-border rounded-xl shadow-lg">
|
|
37
40
|
<p className="label text-sm font-semibold text-foreground">{`Date: ${new Date(data.date).toLocaleString()}`}</p>
|
|
38
41
|
<p className="text-xs text-foreground">{`Duration: ${formatDuration(data.duration)}`}</p>
|
|
39
|
-
<p className="text-xs" style={{
|
|
42
|
+
<p className="text-xs capitalize font-medium" style={{
|
|
40
43
|
color: data.status === "passed"
|
|
41
44
|
? "hsl(var(--chart-3))"
|
|
42
|
-
: data.status === "
|
|
43
|
-
? "hsl(var(--
|
|
44
|
-
: "
|
|
45
|
+
: data.status === "flaky"
|
|
46
|
+
? "hsl(var(--flaky))"
|
|
47
|
+
: data.status === "failed" || data.status === "timedOut"
|
|
48
|
+
? "hsl(var(--destructive))"
|
|
49
|
+
: "hsl(var(--accent))",
|
|
45
50
|
}}>
|
|
46
51
|
{`Status: ${data.status}`}
|
|
47
52
|
</p>
|
|
@@ -104,6 +109,11 @@ function getStatusBadgeStyle(status) {
|
|
|
104
109
|
backgroundColor: "hsl(var(--primary))",
|
|
105
110
|
color: "hsl(var(--primary-foreground))",
|
|
106
111
|
};
|
|
112
|
+
case "flaky":
|
|
113
|
+
return {
|
|
114
|
+
backgroundColor: "hsl(var(--flaky))",
|
|
115
|
+
color: "hsl(var(--flaky-foreground))",
|
|
116
|
+
};
|
|
107
117
|
default:
|
|
108
118
|
return {
|
|
109
119
|
backgroundColor: "hsl(var(--muted))",
|
|
@@ -132,24 +142,388 @@ function getAttachmentNameFromPath(path, defaultName = "Attachment") {
|
|
|
132
142
|
const parts = path.split(/[/\\]/);
|
|
133
143
|
return parts.pop() || defaultName;
|
|
134
144
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
// --- Reusable Tab Content Components ---
|
|
146
|
+
function StepsTabContent({ test }) {
|
|
147
|
+
return (<div className="mt-4 p-1 md:p-4 border rounded-2xl bg-card shadow-inner">
|
|
148
|
+
<h3 className="text-lg font-semibold text-foreground mb-3 px-3 md:px-0">
|
|
149
|
+
Test Execution Steps
|
|
150
|
+
</h3>
|
|
151
|
+
{test.errorMessage && (<div className="mb-4 p-3 md:p-0">
|
|
152
|
+
<h4 className="font-semibold text-md text-destructive mb-1">
|
|
153
|
+
Overall Test Error:
|
|
154
|
+
</h4>
|
|
155
|
+
<pre className="bg-destructive/10 text-sm p-4 rounded-2xl whitespace-pre-wrap break-all font-code overflow-x-auto">
|
|
156
|
+
<span dangerouslySetInnerHTML={{
|
|
157
|
+
__html: ansiToHtml(test.errorMessage),
|
|
158
|
+
}}/>
|
|
159
|
+
</pre>
|
|
160
|
+
</div>)}
|
|
161
|
+
{test.annotations && test.annotations.length > 0 && (<div className="mb-4 p-3 md:p-0">
|
|
162
|
+
<div style={{
|
|
163
|
+
margin: "12px 0",
|
|
164
|
+
padding: "12px",
|
|
165
|
+
backgroundColor: "rgba(139, 92, 246, 0.1)",
|
|
166
|
+
border: "1px solid rgba(139, 92, 246, 0.3)",
|
|
167
|
+
borderLeft: "4px solid #8b5cf6",
|
|
168
|
+
borderRadius: "4px",
|
|
169
|
+
}}>
|
|
170
|
+
<h4 style={{
|
|
171
|
+
marginTop: 0,
|
|
172
|
+
marginBottom: "10px",
|
|
173
|
+
color: "#8b5cf6",
|
|
174
|
+
fontSize: "1.1em",
|
|
175
|
+
}}>
|
|
176
|
+
📌 Annotations
|
|
177
|
+
</h4>
|
|
178
|
+
{test.annotations.map((annotation, index) => (<div key={index} style={{
|
|
179
|
+
marginBottom: index === test.annotations.length - 1 ? "0" : "10px",
|
|
180
|
+
}}>
|
|
181
|
+
<strong style={{ color: "#8b5cf6" }}>Type:</strong>{" "}
|
|
182
|
+
<span style={{
|
|
183
|
+
backgroundColor: "rgba(139, 92, 246, 0.2)",
|
|
184
|
+
padding: "2px 8px",
|
|
185
|
+
borderRadius: "4px",
|
|
186
|
+
fontSize: "0.9em",
|
|
187
|
+
}}>
|
|
188
|
+
{annotation.type}
|
|
189
|
+
</span>
|
|
190
|
+
{annotation.description && (<>
|
|
191
|
+
<br />
|
|
192
|
+
<strong style={{ color: "#8b5cf6" }}>
|
|
193
|
+
Description:
|
|
194
|
+
</strong>{" "}
|
|
195
|
+
{annotation.description}
|
|
196
|
+
</>)}
|
|
197
|
+
{annotation.location && (<div style={{
|
|
198
|
+
fontSize: "0.85em",
|
|
199
|
+
color: "#6b7280",
|
|
200
|
+
marginTop: "4px",
|
|
201
|
+
}}>
|
|
202
|
+
Location: {annotation.location.file}:
|
|
203
|
+
{annotation.location.line}:{annotation.location.column}
|
|
204
|
+
</div>)}
|
|
205
|
+
</div>))}
|
|
206
|
+
</div>
|
|
207
|
+
</div>)}
|
|
208
|
+
{test.steps && test.steps.length > 0 ? (<ScrollArea className="h-[600px] w-full">
|
|
209
|
+
<div className="pr-4">
|
|
210
|
+
{test.steps.map((step, index) => (<TestStepItemRecursive key={step.id || index} step={step}/>))}
|
|
211
|
+
</div>
|
|
212
|
+
</ScrollArea>) : (<p className="text-muted-foreground p-3 md:p-0">
|
|
213
|
+
No detailed execution steps available for this test.
|
|
214
|
+
</p>)}
|
|
215
|
+
</div>);
|
|
216
|
+
}
|
|
217
|
+
function LogsTabContent({ test }) {
|
|
218
|
+
return (<div className="mt-4 p-4 border rounded-2xl bg-card space-y-6 shadow-inner">
|
|
219
|
+
<div>
|
|
220
|
+
<h3 className="text-lg font-semibold text-foreground mb-3 flex items-center">
|
|
221
|
+
<Terminal className="h-5 w-5 mr-2 text-primary"/>
|
|
222
|
+
Console Logs / Standard Output
|
|
223
|
+
</h3>
|
|
224
|
+
<ScrollArea className="h-48 w-full rounded-2xl border p-3 bg-muted/30 shadow-sm">
|
|
225
|
+
<pre className="text-sm whitespace-pre-wrap break-words font-code">
|
|
226
|
+
<span dangerouslySetInnerHTML={{
|
|
227
|
+
__html: ansiToHtml(test.stdout &&
|
|
228
|
+
Array.isArray(test.stdout) &&
|
|
229
|
+
test.stdout.length > 0
|
|
230
|
+
? test.stdout.join("\n")
|
|
231
|
+
: "No standard output logs captured for this test."),
|
|
232
|
+
}}/>
|
|
233
|
+
</pre>
|
|
234
|
+
</ScrollArea>
|
|
235
|
+
</div>
|
|
236
|
+
<div>
|
|
237
|
+
<h3 className="text-lg font-semibold text-foreground mb-3 flex items-center">
|
|
238
|
+
<AlertCircle className="h-5 w-5 mr-2 text-destructive"/>
|
|
239
|
+
Error Messages / Standard Error
|
|
240
|
+
</h3>
|
|
241
|
+
<ScrollArea className="h-48 w-full rounded-2xl border bg-destructive/5 shadow-sm">
|
|
242
|
+
<pre className="text-sm p-3 whitespace-pre-wrap break-all font-code">
|
|
243
|
+
<span dangerouslySetInnerHTML={{
|
|
244
|
+
__html: ansiToHtml(test.errorMessage ||
|
|
245
|
+
"No errors captured for this test."),
|
|
246
|
+
}}/>
|
|
247
|
+
</pre>
|
|
248
|
+
</ScrollArea>
|
|
249
|
+
</div>
|
|
250
|
+
{test.snippet && (<div>
|
|
251
|
+
<h3 className="text-lg font-semibold text-foreground mb-3 flex items-center">
|
|
252
|
+
<FileCode className="h-5 w-5 mr-2 text-primary"/>
|
|
253
|
+
Test Case Snippet
|
|
254
|
+
</h3>
|
|
255
|
+
<ScrollArea className="h-48 w-full rounded-2xl border p-3 bg-muted/30 shadow-sm">
|
|
256
|
+
<pre className="text-sm whitespace-pre-wrap break-words font-code">
|
|
257
|
+
<span dangerouslySetInnerHTML={{
|
|
258
|
+
__html: ansiToHtml(test.snippet),
|
|
259
|
+
}}/>
|
|
260
|
+
</pre>
|
|
261
|
+
</ScrollArea>
|
|
262
|
+
</div>)}
|
|
263
|
+
</div>);
|
|
264
|
+
}
|
|
265
|
+
function AttachmentsTabContent({ test }) {
|
|
266
|
+
const screenshotAttachments = useMemo(() => {
|
|
267
|
+
if (!test || !Array.isArray(test.screenshots))
|
|
268
|
+
return [];
|
|
269
|
+
return test.screenshots.map((path, index) => ({
|
|
270
|
+
name: getAttachmentNameFromPath(path, `Screenshot ${index + 1}`),
|
|
271
|
+
path: path,
|
|
272
|
+
contentType: "image/png",
|
|
273
|
+
"data-ai-hint": `screenshot ${index + 1}`,
|
|
274
|
+
}));
|
|
275
|
+
}, [test]);
|
|
276
|
+
const videoAttachments = useMemo(() => {
|
|
277
|
+
if (!test || !Array.isArray(test.videoPath))
|
|
278
|
+
return [];
|
|
279
|
+
return test.videoPath.map((path, index) => ({
|
|
280
|
+
name: getAttachmentNameFromPath(path, `Video ${index + 1}`),
|
|
281
|
+
path: path,
|
|
282
|
+
contentType: "video/mp4",
|
|
283
|
+
"data-ai-hint": `video ${index + 1}`,
|
|
284
|
+
}));
|
|
285
|
+
}, [test]);
|
|
286
|
+
const traceAttachment = useMemo(() => {
|
|
287
|
+
if (!test || typeof test.tracePath !== "string" || !test.tracePath)
|
|
288
|
+
return null;
|
|
289
|
+
return {
|
|
290
|
+
name: getAttachmentNameFromPath(test.tracePath, "trace.zip"),
|
|
291
|
+
path: test.tracePath,
|
|
292
|
+
contentType: "application/zip",
|
|
293
|
+
};
|
|
294
|
+
}, [test]);
|
|
295
|
+
const allOtherAttachments = useMemo(() => {
|
|
296
|
+
if (!test || !Array.isArray(test.attachments))
|
|
297
|
+
return [];
|
|
298
|
+
return test.attachments.map((att, index) => ({
|
|
299
|
+
name: att.name ||
|
|
300
|
+
getAttachmentNameFromPath(att.path, `Attachment ${index + 1}`),
|
|
301
|
+
path: att.path,
|
|
302
|
+
contentType: att.contentType || "application/octet-stream",
|
|
303
|
+
"data-ai-hint": att["data-ai-hint"],
|
|
304
|
+
}));
|
|
305
|
+
}, [test]);
|
|
306
|
+
const htmlAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().includes("html")), [allOtherAttachments]);
|
|
307
|
+
const pdfAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().includes("pdf")), [allOtherAttachments]);
|
|
308
|
+
const jsonAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().includes("json")), [allOtherAttachments]);
|
|
309
|
+
const textCsvAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().startsWith("text/") ||
|
|
310
|
+
a.contentType.toLowerCase().includes("csv")), [allOtherAttachments]);
|
|
311
|
+
const otherGenericAttachments = useMemo(() => allOtherAttachments.filter((a) => !htmlAttachments.includes(a) &&
|
|
312
|
+
!pdfAttachments.includes(a) &&
|
|
313
|
+
!jsonAttachments.includes(a) &&
|
|
314
|
+
!textCsvAttachments.includes(a)), [
|
|
315
|
+
allOtherAttachments,
|
|
316
|
+
htmlAttachments,
|
|
317
|
+
pdfAttachments,
|
|
318
|
+
jsonAttachments,
|
|
319
|
+
textCsvAttachments,
|
|
320
|
+
]);
|
|
321
|
+
return (<div className="mt-4 p-1 md:p-4 border rounded-2xl bg-card shadow-inner">
|
|
322
|
+
<Tabs defaultValue="sub-screenshots" className="w-full">
|
|
323
|
+
<ScrollArea className="w-full whitespace-nowrap rounded-2xl">
|
|
324
|
+
<TabsList className="inline-grid w-max grid-flow-col mb-4 rounded-2xl">
|
|
325
|
+
<TabsTrigger value="sub-screenshots" disabled={screenshotAttachments.length === 0}>
|
|
326
|
+
<ImageIcon className="h-4 w-4 mr-2"/>
|
|
327
|
+
Screenshots ({screenshotAttachments.length})
|
|
328
|
+
</TabsTrigger>
|
|
329
|
+
<TabsTrigger value="sub-video" disabled={videoAttachments.length === 0}>
|
|
330
|
+
<Film className="h-4 w-4 mr-2"/>
|
|
331
|
+
Videos ({videoAttachments.length})
|
|
332
|
+
</TabsTrigger>
|
|
333
|
+
<TabsTrigger value="sub-trace" disabled={!traceAttachment}>
|
|
334
|
+
<Archive className="h-4 w-4 mr-2"/>
|
|
335
|
+
Trace {traceAttachment ? "(1)" : "(0)"}
|
|
336
|
+
</TabsTrigger>
|
|
337
|
+
<TabsTrigger value="sub-html" disabled={htmlAttachments.length === 0}>
|
|
338
|
+
<FileCode className="h-4 w-4 mr-2"/>
|
|
339
|
+
HTML ({htmlAttachments.length})
|
|
340
|
+
</TabsTrigger>
|
|
341
|
+
<TabsTrigger value="sub-pdf" disabled={pdfAttachments.length === 0}>
|
|
342
|
+
<FileText className="h-4 w-4 mr-2"/>
|
|
343
|
+
PDF ({pdfAttachments.length})
|
|
344
|
+
</TabsTrigger>
|
|
345
|
+
<TabsTrigger value="sub-json" disabled={jsonAttachments.length === 0}>
|
|
346
|
+
<FileJson className="h-4 w-4 mr-2"/>
|
|
347
|
+
JSON ({jsonAttachments.length})
|
|
348
|
+
</TabsTrigger>
|
|
349
|
+
<TabsTrigger value="sub-text" disabled={textCsvAttachments.length === 0}>
|
|
350
|
+
<FileText className="h-4 w-4 mr-2"/>
|
|
351
|
+
Text/CSV ({textCsvAttachments.length})
|
|
352
|
+
</TabsTrigger>
|
|
353
|
+
<TabsTrigger value="sub-other" disabled={otherGenericAttachments.length === 0}>
|
|
354
|
+
<FileIcon className="h-4 w-4 mr-2"/>
|
|
355
|
+
Others ({otherGenericAttachments.length})
|
|
356
|
+
</TabsTrigger>
|
|
357
|
+
</TabsList>
|
|
358
|
+
</ScrollArea>
|
|
359
|
+
|
|
360
|
+
<TabsContent value="sub-screenshots" className="mt-4">
|
|
361
|
+
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
362
|
+
Screenshots
|
|
363
|
+
</h3>
|
|
364
|
+
{screenshotAttachments.length > 0 ? (<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
|
365
|
+
{screenshotAttachments.map((attachment, index) => {
|
|
366
|
+
const imageSrc = getUtilAssetPath(attachment.path);
|
|
367
|
+
if (imageSrc === "#")
|
|
368
|
+
return null;
|
|
369
|
+
return (<a key={`img-preview-${index}`} href={imageSrc} target="_blank" rel="noopener noreferrer" className="relative aspect-video rounded-2xl overflow-hidden group border hover:border-primary transition-all shadow-md hover:shadow-lg">
|
|
370
|
+
<Image src={imageSrc} alt={attachment.name || `Screenshot ${index + 1}`} fill={true} style={{ objectFit: "cover" }} className="group-hover:scale-105 transition-transform duration-300" data-ai-hint={attachment["data-ai-hint"] || "test screenshot"}/>
|
|
371
|
+
<div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center p-2">
|
|
372
|
+
<p className="text-white text-xs text-center break-all">
|
|
373
|
+
{attachment.name || `Screenshot ${index + 1}`}
|
|
374
|
+
</p>
|
|
375
|
+
</div>
|
|
376
|
+
</a>);
|
|
377
|
+
})}
|
|
378
|
+
</div>) : (<p className="text-muted-foreground">
|
|
379
|
+
No screenshots available for this test.
|
|
380
|
+
</p>)}
|
|
381
|
+
</TabsContent>
|
|
382
|
+
|
|
383
|
+
<TabsContent value="sub-video" className="mt-4">
|
|
384
|
+
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
385
|
+
Video Recording(s)
|
|
386
|
+
</h3>
|
|
387
|
+
<div className="space-y-4">
|
|
388
|
+
{videoAttachments.length > 0 ? (videoAttachments.map((attachment, index) => (<div key={`video-${index}`} className="p-4 border rounded-2xl bg-muted/30 shadow-sm flex items-center justify-between">
|
|
389
|
+
<p className="text-sm font-medium text-foreground truncate" title={attachment.name}>
|
|
390
|
+
{attachment.name}
|
|
391
|
+
</p>
|
|
392
|
+
<div className="flex items-center gap-2">
|
|
393
|
+
<Button asChild variant="ghost" size="sm">
|
|
394
|
+
<a href={getUtilAssetPath(attachment.path)} target="_blank" rel="noopener noreferrer">
|
|
395
|
+
View
|
|
396
|
+
</a>
|
|
397
|
+
</Button>
|
|
398
|
+
<Button asChild variant="outline" size="sm">
|
|
399
|
+
<a href={getUtilAssetPath(attachment.path)} download={attachment.name}>
|
|
400
|
+
<Download className="h-4 w-4 mr-2"/>
|
|
401
|
+
Download
|
|
402
|
+
</a>
|
|
403
|
+
</Button>
|
|
404
|
+
</div>
|
|
405
|
+
</div>))) : (<Alert className="rounded-2xl">
|
|
406
|
+
<Info className="h-4 w-4"/>
|
|
407
|
+
<AlertTitle>No Videos Available</AlertTitle>
|
|
408
|
+
<AlertDescription>
|
|
409
|
+
There is no video recording associated with this test
|
|
410
|
+
run.
|
|
411
|
+
</AlertDescription>
|
|
412
|
+
</Alert>)}
|
|
413
|
+
</div>
|
|
414
|
+
</TabsContent>
|
|
415
|
+
|
|
416
|
+
<TabsContent value="sub-trace" className="mt-4">
|
|
417
|
+
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
418
|
+
Trace File
|
|
419
|
+
</h3>
|
|
420
|
+
{traceAttachment ? (<div className="p-4 border rounded-2xl bg-muted/30 space-y-3 shadow-sm">
|
|
421
|
+
<a href={getUtilAssetPath(traceAttachment.path)} target="_blank" rel="noopener noreferrer" className="inline-flex items-center text-primary hover:underline text-base" download={traceAttachment.name}>
|
|
422
|
+
<Download className="h-5 w-5 mr-2"/> Download Trace
|
|
423
|
+
File ({traceAttachment.name})
|
|
424
|
+
</a>
|
|
425
|
+
<p className="text-xs text-muted-foreground">
|
|
426
|
+
Path: {traceAttachment.path}
|
|
427
|
+
</p>
|
|
428
|
+
<Alert className="rounded-2xl">
|
|
429
|
+
<Info className="h-4 w-4"/>
|
|
430
|
+
<AlertTitle>Using Trace Files</AlertTitle>
|
|
431
|
+
<AlertDescription>
|
|
432
|
+
Trace files (.zip) can be viewed using the Playwright
|
|
433
|
+
CLI:{" "}
|
|
434
|
+
<code className="bg-muted px-1 py-0.5 rounded-xl">
|
|
435
|
+
npx playwright show-trace /path/to/your/trace.zip
|
|
436
|
+
</code>
|
|
437
|
+
. Or by uploading them to{" "}
|
|
438
|
+
<a href="https://trace.playwright.dev/" target="_blank" rel="noopener noreferrer" className="underline">
|
|
439
|
+
trace.playwright.dev
|
|
440
|
+
</a>
|
|
441
|
+
.
|
|
442
|
+
</AlertDescription>
|
|
443
|
+
</Alert>
|
|
444
|
+
</div>) : (<Alert className="rounded-2xl">
|
|
445
|
+
<Info className="h-4 w-4"/>
|
|
446
|
+
<AlertTitle>No Trace File Available</AlertTitle>
|
|
447
|
+
<AlertDescription>
|
|
448
|
+
There is no Playwright trace file associated with this
|
|
449
|
+
test run.
|
|
450
|
+
</AlertDescription>
|
|
451
|
+
</Alert>)}
|
|
452
|
+
</TabsContent>
|
|
453
|
+
|
|
454
|
+
{[
|
|
455
|
+
{
|
|
456
|
+
value: "sub-html",
|
|
457
|
+
title: "HTML Files",
|
|
458
|
+
attachments: htmlAttachments,
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
value: "sub-pdf",
|
|
462
|
+
title: "PDF Documents",
|
|
463
|
+
attachments: pdfAttachments,
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
value: "sub-json",
|
|
467
|
+
title: "JSON Files",
|
|
468
|
+
attachments: jsonAttachments,
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
value: "sub-text",
|
|
472
|
+
title: "Text & CSV Files",
|
|
473
|
+
attachments: textCsvAttachments,
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
value: "sub-other",
|
|
477
|
+
title: "Other Files",
|
|
478
|
+
attachments: otherGenericAttachments,
|
|
479
|
+
},
|
|
480
|
+
].map((tab) => (<TabsContent key={tab.value} value={tab.value} className="mt-4">
|
|
481
|
+
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
482
|
+
{tab.title}
|
|
483
|
+
</h3>
|
|
484
|
+
<div className="space-y-3">
|
|
485
|
+
{tab.attachments.length > 0 ? (tab.attachments.map((attachment, index) => (<div key={index} className="p-3 border rounded-2xl bg-muted/30 shadow-sm flex items-center justify-between gap-4">
|
|
486
|
+
<div className="flex items-center gap-3 truncate">
|
|
487
|
+
<AttachmentIcon contentType={attachment.contentType}/>
|
|
488
|
+
<div className="truncate">
|
|
489
|
+
<p className="text-sm font-medium text-foreground truncate" title={attachment.name}>
|
|
490
|
+
{attachment.name}
|
|
491
|
+
</p>
|
|
492
|
+
<p className="text-xs text-muted-foreground">
|
|
493
|
+
{attachment.contentType}
|
|
494
|
+
</p>
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
<div className="flex items-center flex-shrink-0 gap-2">
|
|
498
|
+
<Button asChild variant="ghost" size="sm">
|
|
499
|
+
<a href={getUtilAssetPath(attachment.path)} target="_blank" rel="noopener noreferrer">
|
|
500
|
+
View
|
|
501
|
+
</a>
|
|
502
|
+
</Button>
|
|
503
|
+
<Button asChild variant="outline" size="sm">
|
|
504
|
+
<a href={getUtilAssetPath(attachment.path)} download={attachment.name}>
|
|
505
|
+
<Download className="h-4 w-4 mr-2"/>
|
|
506
|
+
Download
|
|
507
|
+
</a>
|
|
508
|
+
</Button>
|
|
509
|
+
</div>
|
|
510
|
+
</div>))) : (<Alert className="rounded-2xl">
|
|
511
|
+
<Info className="h-4 w-4"/>
|
|
512
|
+
<AlertTitle>No Files Available</AlertTitle>
|
|
513
|
+
<AlertDescription>
|
|
514
|
+
No attachments of this type were found for this
|
|
515
|
+
test.
|
|
516
|
+
</AlertDescription>
|
|
517
|
+
</Alert>)}
|
|
518
|
+
</div>
|
|
519
|
+
</TabsContent>))}
|
|
520
|
+
</Tabs>
|
|
521
|
+
</div>);
|
|
522
|
+
}
|
|
523
|
+
function AiSuggestionsTabContent({ test }) {
|
|
144
524
|
const [aiSuggestion, setAiSuggestion] = useState(null);
|
|
145
525
|
const [isGeneratingSuggestion, setIsGeneratingSuggestion] = useState(false);
|
|
146
526
|
const [aiSuggestionError, setAiSuggestionError] = useState(null);
|
|
147
|
-
const [historyFetched, setHistoryFetched] = useState(false);
|
|
148
|
-
const [selectedRunTimestamp, setSelectedRunTimestamp] = useState("current");
|
|
149
|
-
const initialTest = useMemo(() => {
|
|
150
|
-
return (currentRun?.results?.find((t) => t.id === testId) ||
|
|
151
|
-
null);
|
|
152
|
-
}, [currentRun, testId]);
|
|
153
527
|
const handleGenerateSuggestion = async () => {
|
|
154
528
|
if (!test)
|
|
155
529
|
return;
|
|
@@ -186,9 +560,131 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
186
560
|
setIsGeneratingSuggestion(false);
|
|
187
561
|
}
|
|
188
562
|
};
|
|
563
|
+
return (<div className="mt-4 p-4 border rounded-2xl bg-card shadow-inner">
|
|
564
|
+
<div className="flex flex-col items-center justify-center text-center p-2 md:p-6">
|
|
565
|
+
<h3 className="text-lg font-semibold text-foreground mb-3 flex items-center">
|
|
566
|
+
<Sparkles className="h-5 w-5 mr-2 text-primary"/>
|
|
567
|
+
AI-Powered Failure Analysis
|
|
568
|
+
</h3>
|
|
569
|
+
|
|
570
|
+
{!(isGeneratingSuggestion ||
|
|
571
|
+
aiSuggestion ||
|
|
572
|
+
aiSuggestionError) && (<>
|
|
573
|
+
<p className="text-muted-foreground text-sm mb-6 max-w-md">
|
|
574
|
+
Get suggestions from AI to help diagnose the root cause
|
|
575
|
+
of this test failure and find potential solutions.
|
|
576
|
+
</p>
|
|
577
|
+
<Button onClick={handleGenerateSuggestion} disabled={isGeneratingSuggestion}>
|
|
578
|
+
<Sparkles className="h-4 w-4 mr-2"/>
|
|
579
|
+
Generate Suggestion
|
|
580
|
+
</Button>
|
|
581
|
+
</>)}
|
|
582
|
+
|
|
583
|
+
{isGeneratingSuggestion && (<div className="flex flex-col items-center justify-center py-10">
|
|
584
|
+
<Sparkles className="h-8 w-8 text-primary animate-pulse mb-4"/>
|
|
585
|
+
<p className="text-muted-foreground">
|
|
586
|
+
Generating suggestion... Please wait.
|
|
587
|
+
</p>
|
|
588
|
+
</div>)}
|
|
589
|
+
|
|
590
|
+
{aiSuggestionError && (<div className="w-full text-left">
|
|
591
|
+
<Alert variant="destructive">
|
|
592
|
+
<AlertTitle>Error Generating Suggestion</AlertTitle>
|
|
593
|
+
<AlertDescription>{aiSuggestionError}</AlertDescription>
|
|
594
|
+
</Alert>
|
|
595
|
+
<Button onClick={handleGenerateSuggestion} variant="outline" size="sm" className="mt-4">
|
|
596
|
+
<Sparkles className="h-4 w-4 mr-2"/>
|
|
597
|
+
Try Again
|
|
598
|
+
</Button>
|
|
599
|
+
</div>)}
|
|
600
|
+
|
|
601
|
+
{aiSuggestion && (<div className="text-left w-full mt-6 space-y-6">
|
|
602
|
+
<Alert variant="default" className="border-primary/30 bg-primary/5">
|
|
603
|
+
<Lightbulb className="h-5 w-5 text-primary"/>
|
|
604
|
+
<AlertTitle className="text-primary font-semibold">
|
|
605
|
+
Root Cause Analysis
|
|
606
|
+
</AlertTitle>
|
|
607
|
+
<AlertDescription className="text-primary/90">
|
|
608
|
+
{aiSuggestion.rootCause ||
|
|
609
|
+
"No root cause analysis provided."}
|
|
610
|
+
</AlertDescription>
|
|
611
|
+
</Alert>
|
|
612
|
+
|
|
613
|
+
<div>
|
|
614
|
+
<h4 className="font-semibold text-foreground mb-2">
|
|
615
|
+
Affected Tests:
|
|
616
|
+
</h4>
|
|
617
|
+
<div className="flex flex-wrap gap-2">
|
|
618
|
+
{aiSuggestion.affectedTests?.map((testName) => (<Badge key={testName} variant="secondary">
|
|
619
|
+
{testName}
|
|
620
|
+
</Badge>)) || (<p className="text-sm text-muted-foreground">N/A</p>)}
|
|
621
|
+
</div>
|
|
622
|
+
</div>
|
|
623
|
+
|
|
624
|
+
<div>
|
|
625
|
+
<h4 className="font-semibold text-foreground mb-3 flex items-center">
|
|
626
|
+
<Wrench className="h-4 w-4 mr-2"/>
|
|
627
|
+
Suggested Fixes
|
|
628
|
+
</h4>
|
|
629
|
+
<div className="space-y-4">
|
|
630
|
+
{aiSuggestion.suggestedFixes?.map((fix, index) => (<Card key={index} className="bg-card/50 shadow-md">
|
|
631
|
+
<CardHeader>
|
|
632
|
+
<CardTitle className="text-base">
|
|
633
|
+
Suggestion #{index + 1}
|
|
634
|
+
</CardTitle>
|
|
635
|
+
</CardHeader>
|
|
636
|
+
<CardContent>
|
|
637
|
+
<p className="text-sm text-muted-foreground mb-3">
|
|
638
|
+
{fix.description}
|
|
639
|
+
</p>
|
|
640
|
+
{fix.codeSnippet && (<div>
|
|
641
|
+
<h5 className="text-xs font-semibold text-foreground mb-1 flex items-center">
|
|
642
|
+
<FileCode className="h-3 w-3 mr-1.5"/>
|
|
643
|
+
Code Snippet:
|
|
644
|
+
</h5>
|
|
645
|
+
<pre className="bg-muted text-sm p-3 rounded-xl whitespace-pre-wrap font-code overflow-x-auto">
|
|
646
|
+
<code>{fix.codeSnippet}</code>
|
|
647
|
+
</pre>
|
|
648
|
+
</div>)}
|
|
649
|
+
</CardContent>
|
|
650
|
+
</Card>))}
|
|
651
|
+
{(!aiSuggestion.suggestedFixes ||
|
|
652
|
+
aiSuggestion.suggestedFixes.length === 0) && (<p className="text-sm text-muted-foreground">
|
|
653
|
+
No specific fixes were suggested.
|
|
654
|
+
</p>)}
|
|
655
|
+
</div>
|
|
656
|
+
</div>
|
|
657
|
+
|
|
658
|
+
<Button onClick={handleGenerateSuggestion} variant="outline" size="sm" className="mt-4">
|
|
659
|
+
<Sparkles className="h-4 w-4 mr-2"/>
|
|
660
|
+
Regenerate Suggestion
|
|
661
|
+
</Button>
|
|
662
|
+
</div>)}
|
|
663
|
+
</div>
|
|
664
|
+
</div>);
|
|
665
|
+
}
|
|
666
|
+
export function TestDetailsClientPage({ testId }) {
|
|
667
|
+
const router = useRouter();
|
|
668
|
+
const { currentRun, loadingCurrent, errorCurrent } = useTestData();
|
|
669
|
+
const [test, setTest] = useState(null);
|
|
670
|
+
const [historicalReports, setHistoricalReports] = useState([]);
|
|
671
|
+
const [testHistory, setTestHistory] = useState([]);
|
|
672
|
+
const [loadingHistory, setLoadingHistory] = useState(false);
|
|
673
|
+
const [errorHistory, setErrorHistory] = useState(null);
|
|
674
|
+
const historyChartRef = useRef(null);
|
|
675
|
+
const [historyFetched, setHistoryFetched] = useState(false);
|
|
676
|
+
const [selectedRunTimestamp, setSelectedRunTimestamp] = useState("current");
|
|
677
|
+
const initialTest = useMemo(() => {
|
|
678
|
+
return (currentRun?.results?.find((t) => t.id === testId) ||
|
|
679
|
+
null);
|
|
680
|
+
}, [currentRun, testId]);
|
|
189
681
|
useEffect(() => {
|
|
190
682
|
setTest(initialTest);
|
|
191
|
-
|
|
683
|
+
// Reset history states when testId changes to allow refetching for the new test
|
|
684
|
+
setHistoryFetched(false);
|
|
685
|
+
setTestHistory([]);
|
|
686
|
+
setErrorHistory(null);
|
|
687
|
+
}, [initialTest, testId]);
|
|
192
688
|
const fetchTestHistory = useCallback(async () => {
|
|
193
689
|
if (!testId ||
|
|
194
690
|
historyFetched ||
|
|
@@ -206,13 +702,22 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
206
702
|
filteredReports.forEach((report) => {
|
|
207
703
|
const historicalTest = report.results.find((r) => r.id === testId && r.suiteName === initialTest.suiteName);
|
|
208
704
|
if (historicalTest) {
|
|
705
|
+
const finalStatus = getEffectiveTestStatus(historicalTest);
|
|
209
706
|
historyData.push({
|
|
210
707
|
date: report.run.timestamp,
|
|
211
708
|
duration: historicalTest.duration,
|
|
212
|
-
status:
|
|
709
|
+
status: finalStatus,
|
|
213
710
|
});
|
|
214
711
|
}
|
|
215
712
|
});
|
|
713
|
+
// Add the current run to historyData so it shows up in the chart
|
|
714
|
+
if (initialTest && currentRun?.run?.timestamp) {
|
|
715
|
+
historyData.push({
|
|
716
|
+
date: currentRun.run.timestamp,
|
|
717
|
+
duration: initialTest.duration,
|
|
718
|
+
status: getEffectiveTestStatus(initialTest),
|
|
719
|
+
});
|
|
720
|
+
}
|
|
216
721
|
historyData.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
|
217
722
|
setTestHistory(historyData);
|
|
218
723
|
setHistoryFetched(true);
|
|
@@ -237,77 +742,13 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
237
742
|
}
|
|
238
743
|
}
|
|
239
744
|
}, [selectedRunTimestamp, initialTest, historicalReports, testId]);
|
|
240
|
-
const screenshotAttachments = useMemo(() => {
|
|
241
|
-
if (!test || !Array.isArray(test.screenshots))
|
|
242
|
-
return [];
|
|
243
|
-
return test.screenshots.map((path, index) => ({
|
|
244
|
-
name: getAttachmentNameFromPath(path, `Screenshot ${index + 1}`),
|
|
245
|
-
path: path,
|
|
246
|
-
contentType: "image/png",
|
|
247
|
-
"data-ai-hint": `screenshot ${index + 1}`,
|
|
248
|
-
}));
|
|
249
|
-
}, [test]);
|
|
250
|
-
const videoAttachments = useMemo(() => {
|
|
251
|
-
if (!test || !Array.isArray(test.videoPath))
|
|
252
|
-
return [];
|
|
253
|
-
return test.videoPath.map((path, index) => ({
|
|
254
|
-
name: getAttachmentNameFromPath(path, `Video ${index + 1}`),
|
|
255
|
-
path: path,
|
|
256
|
-
contentType: "video/mp4",
|
|
257
|
-
"data-ai-hint": `video ${index + 1}`,
|
|
258
|
-
}));
|
|
259
|
-
}, [test]);
|
|
260
|
-
const traceAttachment = useMemo(() => {
|
|
261
|
-
if (!test || typeof test.tracePath !== "string" || !test.tracePath)
|
|
262
|
-
return null;
|
|
263
|
-
return {
|
|
264
|
-
name: getAttachmentNameFromPath(test.tracePath, "trace.zip"),
|
|
265
|
-
path: test.tracePath,
|
|
266
|
-
contentType: "application/zip",
|
|
267
|
-
};
|
|
268
|
-
}, [test]);
|
|
269
|
-
const allOtherAttachments = useMemo(() => {
|
|
270
|
-
if (!test || !Array.isArray(test.attachments))
|
|
271
|
-
return [];
|
|
272
|
-
return test.attachments.map((att, index) => ({
|
|
273
|
-
name: att.name ||
|
|
274
|
-
getAttachmentNameFromPath(att.path, `Attachment ${index + 1}`),
|
|
275
|
-
path: att.path,
|
|
276
|
-
contentType: att.contentType || "application/octet-stream",
|
|
277
|
-
"data-ai-hint": att["data-ai-hint"],
|
|
278
|
-
}));
|
|
279
|
-
}, [test]);
|
|
280
|
-
const htmlAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().includes("html")), [allOtherAttachments]);
|
|
281
|
-
const pdfAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().includes("pdf")), [allOtherAttachments]);
|
|
282
|
-
const jsonAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().includes("json")), [allOtherAttachments]);
|
|
283
|
-
const textCsvAttachments = useMemo(() => allOtherAttachments.filter((a) => a.contentType.toLowerCase().startsWith("text/") ||
|
|
284
|
-
a.contentType.toLowerCase().includes("csv")), [allOtherAttachments]);
|
|
285
|
-
const otherGenericAttachments = useMemo(() => allOtherAttachments.filter((a) => !htmlAttachments.includes(a) &&
|
|
286
|
-
!pdfAttachments.includes(a) &&
|
|
287
|
-
!jsonAttachments.includes(a) &&
|
|
288
|
-
!textCsvAttachments.includes(a)), [
|
|
289
|
-
allOtherAttachments,
|
|
290
|
-
htmlAttachments,
|
|
291
|
-
pdfAttachments,
|
|
292
|
-
jsonAttachments,
|
|
293
|
-
textCsvAttachments,
|
|
294
|
-
]);
|
|
295
|
-
const totalAttachmentsCount = useMemo(() => {
|
|
296
|
-
return (screenshotAttachments.length +
|
|
297
|
-
videoAttachments.length +
|
|
298
|
-
(traceAttachment ? 1 : 0) +
|
|
299
|
-
allOtherAttachments.length);
|
|
300
|
-
}, [
|
|
301
|
-
screenshotAttachments,
|
|
302
|
-
videoAttachments,
|
|
303
|
-
traceAttachment,
|
|
304
|
-
allOtherAttachments,
|
|
305
|
-
]);
|
|
306
745
|
// Helper function to get color class based on test status
|
|
307
746
|
const getStatusColorClass = (status) => {
|
|
308
747
|
switch (status) {
|
|
309
748
|
case "passed":
|
|
310
749
|
return "bg-green-500";
|
|
750
|
+
case "flaky":
|
|
751
|
+
return "bg-sky-500";
|
|
311
752
|
case "failed":
|
|
312
753
|
case "timedOut":
|
|
313
754
|
return "bg-red-500";
|
|
@@ -318,35 +759,39 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
318
759
|
}
|
|
319
760
|
};
|
|
320
761
|
const isFailedTest = test?.status === "failed" || test?.status === "timedOut";
|
|
762
|
+
// Calculate retry count by counting failed attempts in history
|
|
763
|
+
const retryCount = test?.retryHistory
|
|
764
|
+
? test.retryHistory.filter((r) => r.status !== "passed" && r.status !== "skipped").length
|
|
765
|
+
: 0;
|
|
321
766
|
if (loadingCurrent && !test) {
|
|
322
767
|
return (<div className="container mx-auto py-8 space-y-6">
|
|
323
|
-
<Skeleton className="h-10 w-48 mb-4 rounded-
|
|
324
|
-
<Card className="shadow-xl rounded-
|
|
768
|
+
<Skeleton className="h-10 w-48 mb-4 rounded-xl"/>
|
|
769
|
+
<Card className="shadow-xl rounded-2xl">
|
|
325
770
|
<CardHeader>
|
|
326
|
-
<Skeleton className="h-8 w-3/4 mb-2 rounded-
|
|
327
|
-
<Skeleton className="h-4 w-1/2 rounded-
|
|
771
|
+
<Skeleton className="h-8 w-3/4 mb-2 rounded-xl"/>
|
|
772
|
+
<Skeleton className="h-4 w-1/2 rounded-xl"/>
|
|
328
773
|
</CardHeader>
|
|
329
774
|
<CardContent className="space-y-4">
|
|
330
|
-
<Skeleton className="h-10 w-1/3 mb-4 rounded-
|
|
331
|
-
<Skeleton className="h-40 w-full rounded-
|
|
775
|
+
<Skeleton className="h-10 w-1/3 mb-4 rounded-xl"/>
|
|
776
|
+
<Skeleton className="h-40 w-full rounded-xl"/>
|
|
332
777
|
</CardContent>
|
|
333
778
|
</Card>
|
|
334
779
|
</div>);
|
|
335
780
|
}
|
|
336
781
|
if (errorCurrent && !test) {
|
|
337
782
|
return (<div className="container mx-auto px-4 py-8">
|
|
338
|
-
<Alert variant="destructive" className="rounded-
|
|
783
|
+
<Alert variant="destructive" className="rounded-2xl">
|
|
339
784
|
<AlertTitle>Error loading test data</AlertTitle>
|
|
340
785
|
<AlertDescription>{errorCurrent}</AlertDescription>
|
|
341
786
|
</Alert>
|
|
342
|
-
<Button onClick={() => router.push("/")} variant="outline" className="mt-4 rounded-
|
|
787
|
+
<Button onClick={() => router.push("/")} variant="outline" className="mt-4 rounded-2xl">
|
|
343
788
|
<ArrowLeft className="mr-2 h-4 w-4"/> Back
|
|
344
789
|
</Button>
|
|
345
790
|
</div>);
|
|
346
791
|
}
|
|
347
792
|
if (!test) {
|
|
348
793
|
return (<div className="container mx-auto px-4 py-8 text-center">
|
|
349
|
-
<Alert className="rounded-
|
|
794
|
+
<Alert className="rounded-2xl">
|
|
350
795
|
<AlertTitle>Test Not Found</AlertTitle>
|
|
351
796
|
<AlertDescription>
|
|
352
797
|
The test with ID '{testId}' could not be found in the current
|
|
@@ -368,7 +813,7 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
368
813
|
<ArrowLeft className="mr-2 h-4 w-4"/> Back to Dashboard
|
|
369
814
|
</Button>
|
|
370
815
|
|
|
371
|
-
<Card className="shadow-xl rounded-
|
|
816
|
+
<Card className="shadow-xl rounded-2xl">
|
|
372
817
|
<CardHeader>
|
|
373
818
|
<div className="flex items-start justify-between">
|
|
374
819
|
<div>
|
|
@@ -395,15 +840,31 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
395
840
|
</div>
|
|
396
841
|
</div>
|
|
397
842
|
<div className="text-right flex-shrink-0">
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
843
|
+
{(() => {
|
|
844
|
+
const effectiveStatus = getEffectiveTestStatus(test);
|
|
845
|
+
return (<Badge variant="outline" className="capitalize text-sm px-3 py-1 rounded-full border" style={getStatusBadgeStyle(effectiveStatus)}>
|
|
846
|
+
{effectiveStatus}
|
|
847
|
+
</Badge>);
|
|
848
|
+
})()}
|
|
401
849
|
<p className="text-sm text-muted-foreground mt-1">
|
|
402
850
|
Duration: {formatDuration(test.duration)}
|
|
403
851
|
</p>
|
|
404
|
-
<
|
|
405
|
-
|
|
406
|
-
|
|
852
|
+
{retryCount > 0 && (<Badge variant="secondary" className="mt-1">
|
|
853
|
+
Retry Count: {retryCount}
|
|
854
|
+
</Badge>)}
|
|
855
|
+
{/* Outcome Badge */}
|
|
856
|
+
{retryCount > 0 && test.status === "passed" && (<Badge variant="outline" className="ml-2 mt-1 border-sky-500 text-sky-600 bg-sky-500/10">
|
|
857
|
+
Flaky
|
|
858
|
+
</Badge>)}
|
|
859
|
+
{/* Severity Badge */}
|
|
860
|
+
{test.annotations?.map((note, i) => {
|
|
861
|
+
if (note.type === 'severity' || note.type === 'priority') {
|
|
862
|
+
return (<Badge key={i} variant="outline" className="ml-2 mt-1 border-blue-500 text-blue-600 bg-blue-500/10 capitalize">
|
|
863
|
+
{note.description || note.type}
|
|
864
|
+
</Badge>);
|
|
865
|
+
}
|
|
866
|
+
return null;
|
|
867
|
+
})}
|
|
407
868
|
{test.tags && test.tags.length > 0 && (<div className="mt-1 space-x-1">
|
|
408
869
|
{test.tags.map((tag) => (<Badge key={tag} variant="secondary" className="text-xs rounded-full">
|
|
409
870
|
{tag}
|
|
@@ -424,13 +885,15 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
424
885
|
</div>
|
|
425
886
|
</SelectTrigger>
|
|
426
887
|
<SelectContent sideOffset={8} className="bg-card/80 backdrop-blur-lg border border-border/50 rounded-xl shadow-2xl data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95">
|
|
427
|
-
<SelectItem value="current" className="rounded-
|
|
888
|
+
<SelectItem value="current" className="rounded-2xl">
|
|
428
889
|
Current Run
|
|
429
890
|
</SelectItem>
|
|
430
|
-
{loadingHistory && (<SelectItem value="loading" disabled className="rounded-
|
|
891
|
+
{loadingHistory && (<SelectItem value="loading" disabled className="rounded-2xl">
|
|
431
892
|
Loading history...
|
|
432
893
|
</SelectItem>)}
|
|
433
|
-
{testHistory
|
|
894
|
+
{testHistory
|
|
895
|
+
.filter((run) => run.date !== currentRun?.run?.timestamp) // Avoid duplicating "Current Run" in dropdown
|
|
896
|
+
.map((run) => (<SelectItem key={run.date} value={run.date} className="rounded-2xl">
|
|
434
897
|
<div className="flex items-center gap-3">
|
|
435
898
|
<span className={cn("h-2 w-2 rounded-full", getStatusColorClass(run.status))} title={`Status: ${run.status}`}/>
|
|
436
899
|
<span className="text-sm">
|
|
@@ -451,346 +914,114 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
451
914
|
fetchTestHistory();
|
|
452
915
|
}
|
|
453
916
|
}}>
|
|
454
|
-
<TabsList className={cn("
|
|
917
|
+
<TabsList className={cn("w-full h-auto mb-6 p-1.5 bg-muted/40 backdrop-blur-sm rounded-2xl border border-border/40 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05),0_2px_5px_rgba(0,0,0,0.05)] grid gap-2", isFailedTest
|
|
455
918
|
? "grid-cols-2 md:grid-cols-5"
|
|
456
919
|
: "grid-cols-2 md:grid-cols-4")}>
|
|
457
|
-
<TabsTrigger value="steps">
|
|
458
|
-
|
|
920
|
+
<TabsTrigger value="steps" className="group relative flex items-center justify-center gap-1.5 sm:gap-2.5 rounded-xl px-2 sm:px-4 py-2 sm:py-2.5 text-xs sm:text-sm whitespace-normal text-center h-auto font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
921
|
+
<span className="relative z-10 flex flex-col xl:flex-row items-center justify-center gap-1 xl:gap-2.5">
|
|
922
|
+
Execution Steps ({test.steps?.length || 0})
|
|
923
|
+
</span>
|
|
459
924
|
</TabsTrigger>
|
|
460
|
-
<TabsTrigger value="attachments">
|
|
461
|
-
|
|
925
|
+
<TabsTrigger value="attachments" className="group relative flex items-center justify-center gap-1.5 sm:gap-2.5 rounded-xl px-2 sm:px-4 py-2 sm:py-2.5 text-xs sm:text-sm whitespace-normal text-center h-auto font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
926
|
+
<span className="relative z-10 flex flex-col xl:flex-row items-center justify-center gap-1 xl:gap-2.5">
|
|
927
|
+
Attachments
|
|
928
|
+
</span>
|
|
462
929
|
</TabsTrigger>
|
|
463
|
-
<TabsTrigger value="logs">
|
|
464
|
-
<
|
|
465
|
-
|
|
930
|
+
<TabsTrigger value="logs" className="group relative flex items-center justify-center gap-1.5 sm:gap-2.5 rounded-xl px-2 sm:px-4 py-2 sm:py-2.5 text-xs sm:text-sm whitespace-normal text-center h-auto font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
931
|
+
<span className="relative z-10 flex flex-col xl:flex-row items-center justify-center gap-1 xl:gap-2.5">
|
|
932
|
+
<FileText className="h-4 w-4 xl:mr-2"/>
|
|
933
|
+
Logs
|
|
934
|
+
</span>
|
|
466
935
|
</TabsTrigger>
|
|
467
|
-
<TabsTrigger value="history"
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
936
|
+
<TabsTrigger value="history" className="group relative flex items-center justify-center gap-1.5 sm:gap-2.5 rounded-xl px-2 sm:px-4 py-2 sm:py-2.5 text-xs sm:text-sm whitespace-normal text-center h-auto font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
937
|
+
<span className="relative z-10 flex flex-col xl:flex-row items-center justify-center gap-1 xl:gap-2.5">
|
|
938
|
+
Test Run History
|
|
939
|
+
</span>
|
|
940
|
+
</TabsTrigger>
|
|
941
|
+
{isFailedTest && (<TabsTrigger value="ai-suggestions" className="group relative flex items-center justify-center gap-1.5 sm:gap-2.5 rounded-xl px-2 sm:px-4 py-2 sm:py-2.5 text-xs sm:text-sm whitespace-normal text-center h-auto font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
942
|
+
<span className="relative z-10 flex flex-col xl:flex-row items-center justify-center gap-1 xl:gap-2.5 text-primary group-data-[state=active]:text-primary group-hover:text-primary transition-colors">
|
|
943
|
+
<Sparkles className="h-4 w-4 xl:mr-2"/>
|
|
944
|
+
AI Suggestions
|
|
945
|
+
</span>
|
|
471
946
|
</TabsTrigger>)}
|
|
472
947
|
</TabsList>
|
|
473
948
|
|
|
474
|
-
<TabsContent value="steps"
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
<
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
</div>)}
|
|
488
|
-
{test.annotations && test.annotations.length > 0 && (<div className="mb-4 p-3 md:p-0">
|
|
489
|
-
<div style={{
|
|
490
|
-
margin: "12px 0",
|
|
491
|
-
padding: "12px",
|
|
492
|
-
backgroundColor: "rgba(139, 92, 246, 0.1)",
|
|
493
|
-
border: "1px solid rgba(139, 92, 246, 0.3)",
|
|
494
|
-
borderLeft: "4px solid #8b5cf6",
|
|
495
|
-
borderRadius: "4px",
|
|
496
|
-
}}>
|
|
497
|
-
<h4 style={{
|
|
498
|
-
marginTop: 0,
|
|
499
|
-
marginBottom: "10px",
|
|
500
|
-
color: "#8b5cf6",
|
|
501
|
-
fontSize: "1.1em",
|
|
502
|
-
}}>
|
|
503
|
-
📌 Annotations
|
|
504
|
-
</h4>
|
|
505
|
-
{test.annotations.map((annotation, index) => (<div key={index} style={{
|
|
506
|
-
marginBottom: index === test.annotations.length - 1 ? "0" : "10px",
|
|
507
|
-
}}>
|
|
508
|
-
<strong style={{ color: "#8b5cf6" }}>Type:</strong>{" "}
|
|
509
|
-
<span style={{
|
|
510
|
-
backgroundColor: "rgba(139, 92, 246, 0.2)",
|
|
511
|
-
padding: "2px 8px",
|
|
512
|
-
borderRadius: "4px",
|
|
513
|
-
fontSize: "0.9em",
|
|
514
|
-
}}>
|
|
515
|
-
{annotation.type}
|
|
949
|
+
<TabsContent value="steps">
|
|
950
|
+
{retryCount > 0 ? (<Tabs defaultValue="base-run" className="w-full">
|
|
951
|
+
<TabsList className="mb-6 h-auto inline-flex p-1.5 bg-muted/40 backdrop-blur-sm rounded-2xl border border-border/40 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05),0_2px_5px_rgba(0,0,0,0.05)] flex-wrap max-w-full gap-2">
|
|
952
|
+
<TabsTrigger value="base-run" className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
953
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
954
|
+
Base Run
|
|
955
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(test.status))}/>
|
|
956
|
+
</span>
|
|
957
|
+
</TabsTrigger>
|
|
958
|
+
{test.retryHistory?.map((retry, index) => (<TabsTrigger key={index} value={`retry-${index}`} className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
959
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
960
|
+
Retry {index + 1}
|
|
961
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(retry.status))}/>
|
|
516
962
|
</span>
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
color: "#6b7280",
|
|
527
|
-
marginTop: "4px",
|
|
528
|
-
}}>
|
|
529
|
-
Location: {annotation.location.file}:
|
|
530
|
-
{annotation.location.line}:{annotation.location.column}
|
|
531
|
-
</div>)}
|
|
532
|
-
</div>))}
|
|
533
|
-
</div>
|
|
534
|
-
</div>)}
|
|
535
|
-
{test.steps && test.steps.length > 0 ? (<ScrollArea className="h-[600px] w-full">
|
|
536
|
-
<div className="pr-4">
|
|
537
|
-
{test.steps.map((step, index) => (<TestStepItemRecursive key={step.id || index} step={step}/>))}
|
|
538
|
-
</div>
|
|
539
|
-
</ScrollArea>) : (<p className="text-muted-foreground p-3 md:p-0">
|
|
540
|
-
No detailed execution steps available for this test.
|
|
541
|
-
</p>)}
|
|
963
|
+
</TabsTrigger>))}
|
|
964
|
+
</TabsList>
|
|
965
|
+
<TabsContent value="base-run">
|
|
966
|
+
<StepsTabContent test={test}/>
|
|
967
|
+
</TabsContent>
|
|
968
|
+
{test.retryHistory?.map((retryTest, index) => (<TabsContent key={index} value={`retry-${index}`}>
|
|
969
|
+
<StepsTabContent test={retryTest}/>
|
|
970
|
+
</TabsContent>))}
|
|
971
|
+
</Tabs>) : (<StepsTabContent test={test}/>)}
|
|
542
972
|
</TabsContent>
|
|
543
973
|
|
|
544
|
-
<TabsContent value="attachments"
|
|
545
|
-
<Tabs defaultValue="
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
<TabsTrigger value="sub-video" disabled={videoAttachments.length === 0}>
|
|
553
|
-
<Film className="h-4 w-4 mr-2"/>
|
|
554
|
-
Videos ({videoAttachments.length})
|
|
555
|
-
</TabsTrigger>
|
|
556
|
-
<TabsTrigger value="sub-trace" disabled={!traceAttachment}>
|
|
557
|
-
<Archive className="h-4 w-4 mr-2"/>
|
|
558
|
-
Trace {traceAttachment ? "(1)" : "(0)"}
|
|
559
|
-
</TabsTrigger>
|
|
560
|
-
<TabsTrigger value="sub-html" disabled={htmlAttachments.length === 0}>
|
|
561
|
-
<FileCode className="h-4 w-4 mr-2"/>
|
|
562
|
-
HTML ({htmlAttachments.length})
|
|
563
|
-
</TabsTrigger>
|
|
564
|
-
<TabsTrigger value="sub-pdf" disabled={pdfAttachments.length === 0}>
|
|
565
|
-
<FileText className="h-4 w-4 mr-2"/>
|
|
566
|
-
PDF ({pdfAttachments.length})
|
|
567
|
-
</TabsTrigger>
|
|
568
|
-
<TabsTrigger value="sub-json" disabled={jsonAttachments.length === 0}>
|
|
569
|
-
<FileJson className="h-4 w-4 mr-2"/>
|
|
570
|
-
JSON ({jsonAttachments.length})
|
|
571
|
-
</TabsTrigger>
|
|
572
|
-
<TabsTrigger value="sub-text" disabled={textCsvAttachments.length === 0}>
|
|
573
|
-
<FileText className="h-4 w-4 mr-2"/>
|
|
574
|
-
Text/CSV ({textCsvAttachments.length})
|
|
575
|
-
</TabsTrigger>
|
|
576
|
-
<TabsTrigger value="sub-other" disabled={otherGenericAttachments.length === 0}>
|
|
577
|
-
<FileIcon className="h-4 w-4 mr-2"/>
|
|
578
|
-
Others ({otherGenericAttachments.length})
|
|
974
|
+
<TabsContent value="attachments">
|
|
975
|
+
{retryCount > 0 ? (<Tabs defaultValue="base-run" className="w-full">
|
|
976
|
+
<TabsList className="mb-6 h-auto inline-flex p-1.5 bg-muted/40 backdrop-blur-sm rounded-2xl border border-border/40 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05),0_2px_5px_rgba(0,0,0,0.05)] flex-wrap max-w-full gap-2">
|
|
977
|
+
<TabsTrigger value="base-run" className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
978
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
979
|
+
Base Run
|
|
980
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(test.status))}/>
|
|
981
|
+
</span>
|
|
579
982
|
</TabsTrigger>
|
|
983
|
+
{test.retryHistory?.map((retry, index) => (<TabsTrigger key={index} value={`retry-${index}`} className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
984
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
985
|
+
Retry {index + 1}
|
|
986
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(retry.status))}/>
|
|
987
|
+
</span>
|
|
988
|
+
</TabsTrigger>))}
|
|
580
989
|
</TabsList>
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
<
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
{screenshotAttachments.map((attachment, index) => {
|
|
589
|
-
const imageSrc = getUtilAssetPath(attachment.path);
|
|
590
|
-
if (imageSrc === "#")
|
|
591
|
-
return null;
|
|
592
|
-
return (<a key={`img-preview-${index}`} href={imageSrc} target="_blank" rel="noopener noreferrer" className="relative aspect-video rounded-lg overflow-hidden group border hover:border-primary transition-all shadow-md hover:shadow-lg">
|
|
593
|
-
<Image src={imageSrc} alt={attachment.name || `Screenshot ${index + 1}`} fill={true} style={{ objectFit: "cover" }} className="group-hover:scale-105 transition-transform duration-300" data-ai-hint={attachment["data-ai-hint"] || "test screenshot"}/>
|
|
594
|
-
<div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center p-2">
|
|
595
|
-
<p className="text-white text-xs text-center break-all">
|
|
596
|
-
{attachment.name || `Screenshot ${index + 1}`}
|
|
597
|
-
</p>
|
|
598
|
-
</div>
|
|
599
|
-
</a>);
|
|
600
|
-
})}
|
|
601
|
-
</div>) : (<p className="text-muted-foreground">
|
|
602
|
-
No screenshots available for this test.
|
|
603
|
-
</p>)}
|
|
604
|
-
</TabsContent>
|
|
605
|
-
|
|
606
|
-
<TabsContent value="sub-video" className="mt-4">
|
|
607
|
-
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
608
|
-
Video Recording(s)
|
|
609
|
-
</h3>
|
|
610
|
-
<div className="space-y-4">
|
|
611
|
-
{videoAttachments.length > 0 ? (videoAttachments.map((attachment, index) => (<div key={`video-${index}`} className="p-4 border rounded-lg bg-muted/30 shadow-sm flex items-center justify-between">
|
|
612
|
-
<p className="text-sm font-medium text-foreground truncate" title={attachment.name}>
|
|
613
|
-
{attachment.name}
|
|
614
|
-
</p>
|
|
615
|
-
<div className="flex items-center gap-2">
|
|
616
|
-
<Button asChild variant="ghost" size="sm">
|
|
617
|
-
<a href={getUtilAssetPath(attachment.path)} target="_blank" rel="noopener noreferrer">
|
|
618
|
-
View
|
|
619
|
-
</a>
|
|
620
|
-
</Button>
|
|
621
|
-
<Button asChild variant="outline" size="sm">
|
|
622
|
-
<a href={getUtilAssetPath(attachment.path)} download={attachment.name}>
|
|
623
|
-
<Download className="h-4 w-4 mr-2"/>
|
|
624
|
-
Download
|
|
625
|
-
</a>
|
|
626
|
-
</Button>
|
|
627
|
-
</div>
|
|
628
|
-
</div>))) : (<Alert className="rounded-lg">
|
|
629
|
-
<Info className="h-4 w-4"/>
|
|
630
|
-
<AlertTitle>No Videos Available</AlertTitle>
|
|
631
|
-
<AlertDescription>
|
|
632
|
-
There is no video recording associated with this test
|
|
633
|
-
run.
|
|
634
|
-
</AlertDescription>
|
|
635
|
-
</Alert>)}
|
|
636
|
-
</div>
|
|
637
|
-
</TabsContent>
|
|
638
|
-
|
|
639
|
-
<TabsContent value="sub-trace" className="mt-4">
|
|
640
|
-
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
641
|
-
Trace File
|
|
642
|
-
</h3>
|
|
643
|
-
{traceAttachment ? (<div className="p-4 border rounded-lg bg-muted/30 space-y-3 shadow-sm">
|
|
644
|
-
<a href={getUtilAssetPath(traceAttachment.path)} target="_blank" rel="noopener noreferrer" className="inline-flex items-center text-primary hover:underline text-base" download={traceAttachment.name}>
|
|
645
|
-
<Download className="h-5 w-5 mr-2"/> Download Trace
|
|
646
|
-
File ({traceAttachment.name})
|
|
647
|
-
</a>
|
|
648
|
-
<p className="text-xs text-muted-foreground">
|
|
649
|
-
Path: {traceAttachment.path}
|
|
650
|
-
</p>
|
|
651
|
-
<Alert className="rounded-lg">
|
|
652
|
-
<Info className="h-4 w-4"/>
|
|
653
|
-
<AlertTitle>Using Trace Files</AlertTitle>
|
|
654
|
-
<AlertDescription>
|
|
655
|
-
Trace files (.zip) can be viewed using the Playwright
|
|
656
|
-
CLI:{" "}
|
|
657
|
-
<code className="bg-muted px-1 py-0.5 rounded-sm">
|
|
658
|
-
npx playwright show-trace /path/to/your/trace.zip
|
|
659
|
-
</code>
|
|
660
|
-
. Or by uploading them to{" "}
|
|
661
|
-
<a href="https://trace.playwright.dev/" target="_blank" rel="noopener noreferrer" className="underline">
|
|
662
|
-
trace.playwright.dev
|
|
663
|
-
</a>
|
|
664
|
-
.
|
|
665
|
-
</AlertDescription>
|
|
666
|
-
</Alert>
|
|
667
|
-
</div>) : (<Alert className="rounded-lg">
|
|
668
|
-
<Info className="h-4 w-4"/>
|
|
669
|
-
<AlertTitle>No Trace File Available</AlertTitle>
|
|
670
|
-
<AlertDescription>
|
|
671
|
-
There is no Playwright trace file associated with this
|
|
672
|
-
test run.
|
|
673
|
-
</AlertDescription>
|
|
674
|
-
</Alert>)}
|
|
675
|
-
</TabsContent>
|
|
676
|
-
|
|
677
|
-
{[
|
|
678
|
-
{
|
|
679
|
-
value: "sub-html",
|
|
680
|
-
title: "HTML Files",
|
|
681
|
-
attachments: htmlAttachments,
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
value: "sub-pdf",
|
|
685
|
-
title: "PDF Documents",
|
|
686
|
-
attachments: pdfAttachments,
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
value: "sub-json",
|
|
690
|
-
title: "JSON Files",
|
|
691
|
-
attachments: jsonAttachments,
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
value: "sub-text",
|
|
695
|
-
title: "Text & CSV Files",
|
|
696
|
-
attachments: textCsvAttachments,
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
value: "sub-other",
|
|
700
|
-
title: "Other Files",
|
|
701
|
-
attachments: otherGenericAttachments,
|
|
702
|
-
},
|
|
703
|
-
].map((tab) => (<TabsContent key={tab.value} value={tab.value} className="mt-4">
|
|
704
|
-
<h3 className="text-lg font-semibold text-foreground mb-4">
|
|
705
|
-
{tab.title}
|
|
706
|
-
</h3>
|
|
707
|
-
<div className="space-y-3">
|
|
708
|
-
{tab.attachments.length > 0 ? (tab.attachments.map((attachment, index) => (<div key={index} className="p-3 border rounded-lg bg-muted/30 shadow-sm flex items-center justify-between gap-4">
|
|
709
|
-
<div className="flex items-center gap-3 truncate">
|
|
710
|
-
<AttachmentIcon contentType={attachment.contentType}/>
|
|
711
|
-
<div className="truncate">
|
|
712
|
-
<p className="text-sm font-medium text-foreground truncate" title={attachment.name}>
|
|
713
|
-
{attachment.name}
|
|
714
|
-
</p>
|
|
715
|
-
<p className="text-xs text-muted-foreground">
|
|
716
|
-
{attachment.contentType}
|
|
717
|
-
</p>
|
|
718
|
-
</div>
|
|
719
|
-
</div>
|
|
720
|
-
<div className="flex items-center flex-shrink-0 gap-2">
|
|
721
|
-
<Button asChild variant="ghost" size="sm">
|
|
722
|
-
<a href={getUtilAssetPath(attachment.path)} target="_blank" rel="noopener noreferrer">
|
|
723
|
-
View
|
|
724
|
-
</a>
|
|
725
|
-
</Button>
|
|
726
|
-
<Button asChild variant="outline" size="sm">
|
|
727
|
-
<a href={getUtilAssetPath(attachment.path)} download={attachment.name}>
|
|
728
|
-
<Download className="h-4 w-4 mr-2"/>
|
|
729
|
-
Download
|
|
730
|
-
</a>
|
|
731
|
-
</Button>
|
|
732
|
-
</div>
|
|
733
|
-
</div>))) : (<Alert className="rounded-lg">
|
|
734
|
-
<Info className="h-4 w-4"/>
|
|
735
|
-
<AlertTitle>No Files Available</AlertTitle>
|
|
736
|
-
<AlertDescription>
|
|
737
|
-
No attachments of this type were found for this
|
|
738
|
-
test.
|
|
739
|
-
</AlertDescription>
|
|
740
|
-
</Alert>)}
|
|
741
|
-
</div>
|
|
742
|
-
</TabsContent>))}
|
|
743
|
-
</Tabs>
|
|
990
|
+
<TabsContent value="base-run">
|
|
991
|
+
<AttachmentsTabContent test={test}/>
|
|
992
|
+
</TabsContent>
|
|
993
|
+
{test.retryHistory?.map((retryTest, index) => (<TabsContent key={index} value={`retry-${index}`}>
|
|
994
|
+
<AttachmentsTabContent test={retryTest}/>
|
|
995
|
+
</TabsContent>))}
|
|
996
|
+
</Tabs>) : (<AttachmentsTabContent test={test}/>)}
|
|
744
997
|
</TabsContent>
|
|
745
998
|
|
|
746
|
-
<TabsContent value="logs"
|
|
747
|
-
<
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
</
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
</
|
|
769
|
-
<ScrollArea className="h-48 w-full rounded-lg border bg-destructive/5 shadow-sm">
|
|
770
|
-
<pre className="text-sm p-3 whitespace-pre-wrap break-all font-code">
|
|
771
|
-
<span dangerouslySetInnerHTML={{
|
|
772
|
-
__html: ansiToHtml(test.errorMessage ||
|
|
773
|
-
"No errors captured for this test."),
|
|
774
|
-
}}/>
|
|
775
|
-
</pre>
|
|
776
|
-
</ScrollArea>
|
|
777
|
-
</div>
|
|
778
|
-
{test.snippet && (<div>
|
|
779
|
-
<h3 className="text-lg font-semibold text-foreground mb-3 flex items-center">
|
|
780
|
-
<FileCode className="h-5 w-5 mr-2 text-primary"/>
|
|
781
|
-
Test Case Snippet
|
|
782
|
-
</h3>
|
|
783
|
-
<ScrollArea className="h-48 w-full rounded-lg border p-3 bg-muted/30 shadow-sm">
|
|
784
|
-
<pre className="text-sm whitespace-pre-wrap break-words font-code">
|
|
785
|
-
<span dangerouslySetInnerHTML={{
|
|
786
|
-
__html: ansiToHtml(test.snippet),
|
|
787
|
-
}}/>
|
|
788
|
-
</pre>
|
|
789
|
-
</ScrollArea>
|
|
790
|
-
</div>)}
|
|
999
|
+
<TabsContent value="logs">
|
|
1000
|
+
{retryCount > 0 ? (<Tabs defaultValue="base-run" className="w-full">
|
|
1001
|
+
<TabsList className="mb-6 h-auto inline-flex p-1.5 bg-muted/40 backdrop-blur-sm rounded-2xl border border-border/40 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05),0_2px_5px_rgba(0,0,0,0.05)] flex-wrap max-w-full gap-2">
|
|
1002
|
+
<TabsTrigger value="base-run" className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
1003
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
1004
|
+
Base Run
|
|
1005
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(test.status))}/>
|
|
1006
|
+
</span>
|
|
1007
|
+
</TabsTrigger>
|
|
1008
|
+
{test.retryHistory?.map((retry, index) => (<TabsTrigger key={index} value={`retry-${index}`} className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
1009
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
1010
|
+
Retry {index + 1}
|
|
1011
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(retry.status))}/>
|
|
1012
|
+
</span>
|
|
1013
|
+
</TabsTrigger>))}
|
|
1014
|
+
</TabsList>
|
|
1015
|
+
<TabsContent value="base-run">
|
|
1016
|
+
<LogsTabContent test={test}/>
|
|
1017
|
+
</TabsContent>
|
|
1018
|
+
{test.retryHistory?.map((retryTest, index) => (<TabsContent key={index} value={`retry-${index}`}>
|
|
1019
|
+
<LogsTabContent test={retryTest}/>
|
|
1020
|
+
</TabsContent>))}
|
|
1021
|
+
</Tabs>) : (<LogsTabContent test={test}/>)}
|
|
791
1022
|
</TabsContent>
|
|
792
1023
|
|
|
793
|
-
<TabsContent value="history" className="mt-4 p-4 border rounded-
|
|
1024
|
+
<TabsContent value="history" className="mt-4 p-4 border rounded-2xl bg-card shadow-inner">
|
|
794
1025
|
<div className="flex justify-between items-center mb-3">
|
|
795
1026
|
<h3 className="text-lg font-semibold text-foreground flex items-center">
|
|
796
1027
|
<LineChart className="h-5 w-5 mr-2 text-primary"/>
|
|
@@ -798,10 +1029,10 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
798
1029
|
</h3>
|
|
799
1030
|
</div>
|
|
800
1031
|
{loadingHistory && (<div className="space-y-3">
|
|
801
|
-
<Skeleton className="h-6 w-3/4 rounded-
|
|
802
|
-
<Skeleton className="h-64 w-full rounded-
|
|
1032
|
+
<Skeleton className="h-6 w-3/4 rounded-xl"/>
|
|
1033
|
+
<Skeleton className="h-64 w-full rounded-2xl"/>
|
|
803
1034
|
</div>)}
|
|
804
|
-
{errorHistory && !loadingHistory && (<Alert variant="destructive" className="rounded-
|
|
1035
|
+
{errorHistory && !loadingHistory && (<Alert variant="destructive" className="rounded-2xl">
|
|
805
1036
|
<AlertCircle className="h-4 w-4"/>
|
|
806
1037
|
<AlertTitle>Error Loading Test History</AlertTitle>
|
|
807
1038
|
<AlertDescription>{errorHistory}</AlertDescription>
|
|
@@ -809,7 +1040,7 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
809
1040
|
{!loadingHistory &&
|
|
810
1041
|
!errorHistory &&
|
|
811
1042
|
historyFetched &&
|
|
812
|
-
testHistory.length === 0 && (<Alert className="rounded-
|
|
1043
|
+
testHistory.length === 0 && (<Alert className="rounded-2xl">
|
|
813
1044
|
<Info className="h-4 w-4"/>
|
|
814
1045
|
<AlertTitle>No Historical Data</AlertTitle>
|
|
815
1046
|
<AlertDescription>
|
|
@@ -817,7 +1048,7 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
817
1048
|
{testId}) in this suite.
|
|
818
1049
|
</AlertDescription>
|
|
819
1050
|
</Alert>)}
|
|
820
|
-
{!loadingHistory && !errorHistory && testHistory.length > 0 && (<div ref={historyChartRef} className="w-full h-[300px] bg-card p-4 rounded-
|
|
1051
|
+
{!loadingHistory && !errorHistory && testHistory.length > 0 && (<div ref={historyChartRef} className="w-full h-[300px] bg-card p-4 rounded-2xl shadow-inner">
|
|
821
1052
|
<ResponsiveContainer width="100%" height="100%">
|
|
822
1053
|
<RechartsLineChart data={[...testHistory].reverse()} // Show oldest to newest
|
|
823
1054
|
margin={{ top: 5, right: 20, left: -20, bottom: 5 }}>
|
|
@@ -835,107 +1066,29 @@ export function TestDetailsClientPage({ testId }) {
|
|
|
835
1066
|
</div>)}
|
|
836
1067
|
</TabsContent>
|
|
837
1068
|
|
|
838
|
-
{isFailedTest && (<TabsContent value="ai-suggestions"
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
Generating suggestion... Please wait.
|
|
862
|
-
</p>
|
|
863
|
-
</div>)}
|
|
864
|
-
|
|
865
|
-
{aiSuggestionError && (<div className="w-full text-left">
|
|
866
|
-
<Alert variant="destructive">
|
|
867
|
-
<AlertTitle>Error Generating Suggestion</AlertTitle>
|
|
868
|
-
<AlertDescription>{aiSuggestionError}</AlertDescription>
|
|
869
|
-
</Alert>
|
|
870
|
-
<Button onClick={handleGenerateSuggestion} variant="outline" size="sm" className="mt-4">
|
|
871
|
-
<Sparkles className="h-4 w-4 mr-2"/>
|
|
872
|
-
Try Again
|
|
873
|
-
</Button>
|
|
874
|
-
</div>)}
|
|
875
|
-
|
|
876
|
-
{aiSuggestion && (<div className="text-left w-full mt-6 space-y-6">
|
|
877
|
-
<Alert variant="default" className="border-primary/30 bg-primary/5">
|
|
878
|
-
<Lightbulb className="h-5 w-5 text-primary"/>
|
|
879
|
-
<AlertTitle className="text-primary font-semibold">
|
|
880
|
-
Root Cause Analysis
|
|
881
|
-
</AlertTitle>
|
|
882
|
-
<AlertDescription className="text-primary/90">
|
|
883
|
-
{aiSuggestion.rootCause ||
|
|
884
|
-
"No root cause analysis provided."}
|
|
885
|
-
</AlertDescription>
|
|
886
|
-
</Alert>
|
|
887
|
-
|
|
888
|
-
<div>
|
|
889
|
-
<h4 className="font-semibold text-foreground mb-2">
|
|
890
|
-
Affected Tests:
|
|
891
|
-
</h4>
|
|
892
|
-
<div className="flex flex-wrap gap-2">
|
|
893
|
-
{aiSuggestion.affectedTests?.map((testName) => (<Badge key={testName} variant="secondary">
|
|
894
|
-
{testName}
|
|
895
|
-
</Badge>)) || (<p className="text-sm text-muted-foreground">N/A</p>)}
|
|
896
|
-
</div>
|
|
897
|
-
</div>
|
|
898
|
-
|
|
899
|
-
<div>
|
|
900
|
-
<h4 className="font-semibold text-foreground mb-3 flex items-center">
|
|
901
|
-
<Wrench className="h-4 w-4 mr-2"/>
|
|
902
|
-
Suggested Fixes
|
|
903
|
-
</h4>
|
|
904
|
-
<div className="space-y-4">
|
|
905
|
-
{aiSuggestion.suggestedFixes?.map((fix, index) => (<Card key={index} className="bg-card/50 shadow-md">
|
|
906
|
-
<CardHeader>
|
|
907
|
-
<CardTitle className="text-base">
|
|
908
|
-
Suggestion #{index + 1}
|
|
909
|
-
</CardTitle>
|
|
910
|
-
</CardHeader>
|
|
911
|
-
<CardContent>
|
|
912
|
-
<p className="text-sm text-muted-foreground mb-3">
|
|
913
|
-
{fix.description}
|
|
914
|
-
</p>
|
|
915
|
-
{fix.codeSnippet && (<div>
|
|
916
|
-
<h5 className="text-xs font-semibold text-foreground mb-1 flex items-center">
|
|
917
|
-
<FileCode className="h-3 w-3 mr-1.5"/>
|
|
918
|
-
Code Snippet:
|
|
919
|
-
</h5>
|
|
920
|
-
<pre className="bg-muted text-sm p-3 rounded-md whitespace-pre-wrap font-code overflow-x-auto">
|
|
921
|
-
<code>{fix.codeSnippet}</code>
|
|
922
|
-
</pre>
|
|
923
|
-
</div>)}
|
|
924
|
-
</CardContent>
|
|
925
|
-
</Card>))}
|
|
926
|
-
{(!aiSuggestion.suggestedFixes ||
|
|
927
|
-
aiSuggestion.suggestedFixes.length === 0) && (<p className="text-sm text-muted-foreground">
|
|
928
|
-
No specific fixes were suggested.
|
|
929
|
-
</p>)}
|
|
930
|
-
</div>
|
|
931
|
-
</div>
|
|
932
|
-
|
|
933
|
-
<Button onClick={handleGenerateSuggestion} variant="outline" size="sm" className="mt-4">
|
|
934
|
-
<Sparkles className="h-4 w-4 mr-2"/>
|
|
935
|
-
Regenerate Suggestion
|
|
936
|
-
</Button>
|
|
937
|
-
</div>)}
|
|
938
|
-
</div>
|
|
1069
|
+
{isFailedTest && (<TabsContent value="ai-suggestions">
|
|
1070
|
+
{retryCount > 0 ? (<Tabs defaultValue="base-run" className="w-full">
|
|
1071
|
+
<TabsList className="mb-6 h-auto inline-flex p-1.5 bg-muted/40 backdrop-blur-sm rounded-2xl border border-border/40 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05),0_2px_5px_rgba(0,0,0,0.05)] flex-wrap max-w-full gap-2">
|
|
1072
|
+
<TabsTrigger value="base-run" className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
1073
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
1074
|
+
Base Run
|
|
1075
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(test.status))}/>
|
|
1076
|
+
</span>
|
|
1077
|
+
</TabsTrigger>
|
|
1078
|
+
{test.retryHistory?.map((retry, index) => (<TabsTrigger key={index} value={`retry-${index}`} className="group relative flex items-center gap-2.5 rounded-xl px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-all duration-300 hover:text-foreground hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.15)] data-[state=active]:border data-[state=active]:border-border/40 border border-transparent overflow-hidden">
|
|
1079
|
+
<span className="relative z-10 flex items-center gap-2.5">
|
|
1080
|
+
Retry {index + 1}
|
|
1081
|
+
<span className={cn("h-2.5 w-2.5 rounded-full ring-[3px] ring-background/60 shadow-sm transition-transform group-hover:scale-110 group-data-[state=active]:scale-125", getStatusColorClass(retry.status))}/>
|
|
1082
|
+
</span>
|
|
1083
|
+
</TabsTrigger>))}
|
|
1084
|
+
</TabsList>
|
|
1085
|
+
<TabsContent value="base-run">
|
|
1086
|
+
<AiSuggestionsTabContent test={test}/>
|
|
1087
|
+
</TabsContent>
|
|
1088
|
+
{test.retryHistory?.map((retryTest, index) => (<TabsContent key={index} value={`retry-${index}`}>
|
|
1089
|
+
<AiSuggestionsTabContent test={retryTest}/>
|
|
1090
|
+
</TabsContent>))}
|
|
1091
|
+
</Tabs>) : (<AiSuggestionsTabContent test={test}/>)}
|
|
939
1092
|
</TabsContent>)}
|
|
940
1093
|
</Tabs>
|
|
941
1094
|
</CardContent>
|