Add API error monitoring tests and error context snapshots for various browsers

- Created error context snapshots for Firefox, WebKit, and Chromium to capture UI state during API error monitoring.
- Implemented e2e tests for API error detection, including console errors, failed API requests, and proxy errors.
- Added functionality to ignore specific API patterns in monitoring assertions.
- Ensured tests validate the monitoring system's ability to detect and report errors effectively.
This commit is contained in:
catlog22
2026-01-31 00:15:59 +08:00
parent f1324a0bc8
commit a0f81f8841
66 changed files with 3112 additions and 3175 deletions

View File

@@ -17,6 +17,7 @@ import {
import { cn } from '@/lib/utils';
import { useHistory } from '@/hooks/useHistory';
import { ConversationCard } from '@/components/shared/ConversationCard';
import { CliStreamPanel } from '@/components/shared/CliStreamPanel';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import {
@@ -35,6 +36,7 @@ import {
DropdownMenuSeparator,
DropdownMenuLabel,
} from '@/components/ui/Dropdown';
import type { CliExecution } from '@/lib/api';
/**
* HistoryPage component - Display CLI execution history
@@ -46,6 +48,8 @@ export function HistoryPage() {
const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false);
const [deleteType, setDeleteType] = React.useState<'single' | 'tool' | 'all' | null>(null);
const [deleteTarget, setDeleteTarget] = React.useState<string | null>(null);
const [selectedExecution, setSelectedExecution] = React.useState<string | null>(null);
const [isPanelOpen, setIsPanelOpen] = React.useState(false);
const {
executions,
@@ -78,6 +82,12 @@ export function HistoryPage() {
const hasActiveFilters = searchQuery.length > 0 || toolFilter !== undefined;
// Card click handler - open execution details panel
const handleCardClick = (execution: CliExecution) => {
setSelectedExecution(execution.id);
setIsPanelOpen(true);
};
// Delete handlers
const handleDeleteClick = (id: string) => {
setDeleteType('single');
@@ -263,6 +273,7 @@ export function HistoryPage() {
<ConversationCard
key={execution.id}
execution={execution}
onClick={handleCardClick}
onDelete={handleDeleteClick}
actionsDisabled={isDeleting}
/>
@@ -270,6 +281,13 @@ export function HistoryPage() {
</div>
)}
{/* CLI Stream Panel */}
<CliStreamPanel
executionId={selectedExecution || ''}
open={isPanelOpen}
onOpenChange={setIsPanelOpen}
/>
{/* Delete Confirmation Dialog */}
<Dialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
<DialogContent>