Skip to content

Latest commit

 

History

History
147 lines (96 loc) · 3.9 KB

File metadata and controls

147 lines (96 loc) · 3.9 KB
title Testing
description Testing protocol schemas

{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

**Source:** `packages/spec/src/qa/testing.zod.ts`

TypeScript Usage

import { TestAction, TestActionType, TestAssertion, TestAssertionType, TestContext, TestScenario, TestStep, TestSuite } from '@objectstack/spec/qa';
import type { TestAction, TestActionType, TestAssertion, TestAssertionType, TestContext, TestScenario, TestStep, TestSuite } from '@objectstack/spec/qa';

// Validate data
const result = TestAction.parse(data);

TestAction

A single test action to execute against the system

Properties

Property Type Required Description
type Enum<'create_record' | 'update_record' | 'delete_record' | 'read_record' | 'query_records' | 'api_call' | 'run_script' | 'wait'> The action type to execute
target string Target Object, API Endpoint, or Function Name
payload Record<string, any> optional Data to send or use
user string optional Run as specific user/role for impersonation testing

TestActionType

Type of test action to perform

Allowed Values

  • create_record
  • update_record
  • delete_record
  • read_record
  • query_records
  • api_call
  • run_script
  • wait

TestAssertion

A test assertion that validates the result of a test action

Properties

Property Type Required Description
field string Field path in the result to check (e.g. "body.data.0.status")
operator Enum<'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_null' | 'not_null' | 'gt' | 'gte' | 'lt' | 'lte' | 'error'> Comparison operator to use
expectedValue any Expected value to compare against

TestAssertionType

Comparison operator for test assertions

Allowed Values

  • equals
  • not_equals
  • contains
  • not_contains
  • is_null
  • not_null
  • gt
  • gte
  • lt
  • lte
  • error


TestScenario

A complete test scenario with setup, execution steps, and teardown

Properties

Property Type Required Description
id string Unique scenario identifier
name string Scenario name for test reports
description string optional Detailed description of the test scenario
tags string[] optional Tags for filtering and categorization (e.g. "critical", "regression", "crm")
setup Object[] optional Steps to run before main test (preconditions)
steps Object[] Main test sequence to execute
teardown Object[] optional Steps to cleanup after test execution
requires Object optional Environment requirements for this scenario

TestStep

A single step in a test scenario, consisting of an action and optional assertions

Properties

Property Type Required Description
name string Step name for identification in test reports
description string optional Human-readable description of what this step tests
action Object The action to execute in this step
assertions Object[] optional Assertions to validate after the action completes
capture Record<string, string> optional Map result fields to context variables: { "newId": "body.id" }

TestSuite

A collection of test scenarios grouped into a test suite

Properties

Property Type Required Description
name string Test suite name
scenarios Object[] List of test scenarios in this suite