Test Results

Comprehensive test results view with metrics, output display, run history, and version comparison

SaaSAI Agents

Overview

TestResults provides a tabbed interface for reviewing AI agent test results. It shows the selected run's details and metrics, test output, a history table of past runs, and an optional version comparison view. Includes a header with test case name, status badge, and relative timestamp.

Usage

import { TestResults } from "@leanicon/web-builder-library/saas";

<TestResults
  testCase={testCase}
  selectedRun={selectedRun}
  testRuns={testRuns}
  onRunSelect={handleRunSelect}
  showVersionComparison={true}
/>;

Variants

No Results Yet

Basic Greeting Response

Verify the agent responds appropriately to a simple greeting.

No test results yet

Run this test case to see the results.

Evaluation Criteria

  • 1.Response includes a greeting
  • 2.Response offers to help
  • 3.Tone is friendly and professional

Dark

Basic Greeting Response

Verify the agent responds appropriately to a simple greeting.

No test results yet

Run this test case to see the results.

Evaluation Criteria

  • 1.Response includes a greeting
  • 2.Response offers to help
  • 3.Tone is friendly and professional

With Run Data (code only)

<TestResults
  testCase={testCase}
  selectedRun={{
    id: "run_001",
    testCaseId: "test_001",
    agentId: "agent_001",
    agentVersionNumber: 3,
    status: "passed",
    output: {
      agentResponse: "Hello! Welcome! How can I assist you today?",
      evaluationNotes: "All criteria met.",
    },
    metrics: {
      responseTimeMs: 1200,
      tokenCount: 45,
      evaluationScore: 0.95,
    },
    startedAt: "2026-02-05T08:00:00Z",
    completedAt: "2026-02-05T08:00:01Z",
    runBy: "user_001",
  }}
  testRuns={testRuns}
  onRunSelect={(run) => setSelectedRun(run)}
  showVersionComparison={true}
/>

Props

NameTypeDefaultRequiredDescription
testCaseTestCase—YesThe test case these results belong to
selectedRunTestRun—NoThe currently selected/most recent test run
testRunsTestRun[]—YesHistorical test runs
onRunSelect((testRun: TestRun) => void)—NoCallback when a historical run is selected
showVersionComparisonbooleantrueNoWhether to show version comparison tab
classNamestring—NoAdditional class names