testzeus-test-authoring
Create and edit TestZeus test definitions in Gherkin, including AI-assisted test generation.
Category: core · Version: 1.0.0 · Requires: testzeus-auth
Triggers: gherkin test, feature file, generate gherkin, author gherkin, magic test, enrich gherkin, from this video, from the recording, walkthrough video, openapi, swagger, postman collection, api spec, tests from the spec
Triggers
See triggers.md for pattern matching rules.
Overview
Guides users through conversational Gherkin test case creation using a multi-step wizard. The wizard collects all necessary information to generate comprehensive test cases using AI-powered generation.
If the user wants Test Blocks (ordered Playwright / tz Python steps, SOQL/Apex/HTTP, verify-then-save), stop and use testzeus-test-blocks. Do not write a .feature file for those tests.
If they only say "create a test" / "write a test" / "new test case" and do not name Gherkin, a feature file, Given/When/Then, or Magic Test, external agents (Claude Code, Cursor, Codex, MCP clients) do not use this skill: create a Test Blocks test with testzeus-test-blocks without asking. the TestZeus platform (in-app chat) asks Gherkin vs Test Blocks first.
CLI Commands
Three entry points depending on how much guidance the user wants, under
testzeus tests-authoring:
# Manual: create a test with a Gherkin feature directly (no AI generation)
testzeus tests-authoring manual --name "login_validation" \
--feature-file ./login.feature \
--environment ENV_ID --tags TAG_ID --data TEST_DATA_ID \
--execution-mode lenient # lenient | strict
# (or --feature "Feature: ..." inline; --test-params / --output-schema
# and their *-file variants; --hypermind-code-blocks id1,id2)
# Quick: minimal-prompt AI generation
testzeus tests-authoring quick --name "login_validation" \
--description "Verify login works and shows errors" \
--count 10 --complexity medium # low | medium | high
# Wizard: interactive, step-by-step (flags pre-fill/skip prompts)
testzeus tests-authoring wizard \
--name "login_validation" --description "..." \
--environment ENV_ID --test-data TD_ID --tags TAG_ID \
--scenarios "valid login; wrong password; locked account" \
--count 8 --complexity mediumRelated test inspection
# Merged input params + defaults for a test (useful before authoring/running)
testzeus tests input-params TEST_ID
# Which suites depend on a test (impact check before editing/deleting)
testzeus tests dependent-suites TEST_IDDesign Philosophy
Hybrid Approach
Combines conversational guidance with structured input components:
- Conversational for intent understanding and guidance
- Structured components for specific inputs (selections, counts)
- Natural language for complex inputs (descriptions, scenarios)
Review-First Workflow
All generated content goes through a review step before saving:
- User can accept, modify, or reject generated test cases
- Allows refinement through additional prompting
- Ensures quality before committing to the test suite
Refinement Loop
Users can iteratively refine generated content:
- Edit generated feature files inline
- Regenerate specific scenarios
- Add or remove test cases before saving
Capabilities
1. Guided Test Creation Wizard
Multi-step conversational wizard that collects:
- Test name (required)
- Test description/goal (required)
- Target environment (optional)
- Test data selection (optional)
- Tags for organization (optional)
- Specific scenarios to cover (optional)
- Number of test cases to generate
- Reasoning complexity level
2. AI-Powered Test Generation
Leverages the tests_ai_generator infrastructure:
- Generates Gherkin-style test scenarios
- Creates step definitions
- Handles edge cases based on complexity setting
- Supports knowledge base integration
3. Generated Content Review
Review interface allows:
- View all generated test cases
- Edit individual test cases
- Remove unwanted test cases
- Regenerate specific scenarios
- Regenerate all with different parameters
4. Test Saving Options
After review:
- Save all generated tests
- Save selected tests only
- Save as draft for later editing
- Discard and start over
5. Tests from an uploaded source
Users can upload a video walkthrough (MP4, MOV or WEBM) or an OpenAPI/Swagger
spec or Postman collection (JSON or YAML). the TestZeus platform reads each into numbered
items (api-<n> for endpoints, vid-<n> for timed user steps) and owns the
procedure for turning them into tests: Bugsy's prompt carries it whenever the
conversation has files. The tools it uses are get_source_inventory,
get_salesforce_schema, ask_user (approval of the outline) and
check_test_coverage (nothing is saved while it reports findings).
Workflow States
idle
│
▼
understanding_goal ──────────► cancel
│ (user wants to create test)
▼
collecting_name
│
▼
collecting_description
│
▼
collecting_environment ──────► skip_environment
│
▼
collecting_test_data ───────► skip_test_data
│
▼
collecting_tags ────────────► skip_tags
│
▼
collecting_scenarios ───────► skip_scenarios
│
▼
collecting_count
│
▼
collecting_complexity
│
▼
confirming_settings
│
▼
generating ──────────────────► regenerate
│
▼
reviewing ──────────────────► edit_generated
│ │
│ ▼
│ generating
▼
saving ─────────────────────► discard
│
▼
complete ────────────────────► idleConversation Flow
Step 1: Understand Intent
Agent asks: "What would you like to test?"
User provides: High-level goal like "login functionality" or "checkout flow"
Agent follows up: "Got it! What should I call this test?"
Step 2: Collect Name
Agent asks: "What should I call this test?"
User provides: A descriptive name like "login_validation" or "checkout_payment"
Validation: Name must be unique, alphanumeric with underscores
Agent follows up: "Perfect! Now briefly describe what this test should verify."
Step 3: Collect Description
Agent asks: "Describe what this test should verify."
User provides: A description like "Verify users can log in with valid credentials and see appropriate errors for invalid ones."
Agent follows up: "Should this test run against a specific environment?"
Step 4: Environment (Optional)
Agent asks: "Select an environment or skip."
Shows: Available environments as selectable options
User selects: e.g., "staging" or "skip"
Agent follows up: "Do you want to use any test data for this test?"
Step 5: Test Data (Optional)
Agent asks: "Select test data or skip."
Shows: Available test data sets
User selects: e.g., "QA Test Users" or "skip"
Agent follows up: "Add any tags to organize this test?"
Step 6: Tags (Optional)
Agent asks: "Add tags or skip."
User provides: Comma-separated tags like "authentication, smoke" or "skip"
Agent follows up: "Describe the specific scenarios to test."
Step 7: Scenarios (Optional)
Agent asks: "What scenarios should I cover? Describe the paths you want tested."
User provides: Natural language description of scenarios
Examples:
- "Log in with valid email and password"
- "Log in with incorrect password shows error"
- "Log in with non-existent email"
- "Session timeout after inactivity"
Agent follows up: "How many test cases should I generate?"
Step 8: Count
Agent asks: "How many test cases? (1-20)"
Shows: Slider component for easy selection
User provides: Number like "8" or uses slider
Agent follows up: "What reasoning complexity level?"
Step 9: Complexity
Agent asks: "Select complexity level:"
Shows: Options with descriptions
- Low: Basic happy path tests
- Medium: Common edge cases included
- High: Thorough coverage with edge cases
User selects: e.g., "medium"
Agent confirms: "Let me show you the summary before generating."
Step 10: Confirm Settings
Agent shows: Summary component with all collected settings
Summary:
- Name: login_validation
- Description: Verify login functionality
- Environment: staging
- Test Data: QA Test Users
- Tags: authentication, smoke
- Scenarios: [user input]
- Test Cases: 8
- Complexity: medium
Ready to generate?User confirms or requests changes
Step 11: Generate
Agent shows: Progress indicator
{
"component": "StatusBadge",
"props": { "status": "generating", "label": "Generating 8 test cases..." }
}When complete: Show generated tests for review
Step 12: Review
Agent shows: List of generated test cases with edit options
{
"component": "AuthoringReview",
"props": {
"testCases": [
{ "id": "1", "name": "Valid login", "status": "generated" },
{ "id": "2", "name": "Invalid password", "status": "generated" },
...
],
"actions": ["save_all", "edit", "regenerate", "discard"]
}
}User can:
- Save all test cases
- Edit specific test cases
- Regenerate all or specific
- Discard and start over
Step 13: Save
On save: Create tests via API
Agent confirms: "Created 8 test cases successfully!"
Response Formatting
Status Display
{
"component": "StatusBadge",
"props": {
"status": "generating",
"label": "Generating test cases..."
}
}Wizard Progress
{
"component": "WizardProgress",
"props": {
"currentStep": 5,
"totalSteps": 10,
"stepName": "Collecting scenarios",
"canGoBack": true
}
}Settings Summary
{
"component": "AuthoringSummary",
"props": {
"name": "login_validation",
"description": "Verify login functionality",
"environment": { "id": "env_1", "name": "staging" },
"testData": [{ "id": "td_1", "name": "QA Test Users" }],
"tags": ["authentication", "smoke"],
"scenarioCount": 8,
"complexity": "medium"
}
}Test Case List
{
"component": "TestCaseList",
"props": {
"testCases": [
{
"id": "gen_1",
"name": "Valid credentials login",
"feature": "Given a user on the login page...",
"selected": true
}
],
"totalGenerated": 8
}
}Confirmation Prompt
{
"component": "ConfirmDialog",
"props": {
"title": "Save Test Cases",
"message": "Save 8 test cases to your suite?",
"confirmLabel": "Save All",
"cancelLabel": "Review Again"
}
}Best Practices
- Be conversational, not robotic - Use natural language transitions between steps
- Provide sensible defaults - Pre-select based on context when possible
- Show, don't just tell - Use components to display options visually
- Allow skipping - Optional fields should be skippable
- Summarize frequently - Help users track what they've entered
- Make edits easy - Allow corrections at any step
- Be patient - Some users need more guidance than others
- Confirm before major actions - Always confirm before generating or saving
- Handle errors gracefully - Explain what went wrong and how to fix it
- Offer alternatives - If generation fails, offer manual test creation
Error Handling
Validation Errors
- Show inline error messages with component schema validation
- Highlight problematic fields
- Suggest corrections
Generation Errors
- Explain the error in plain language
- Offer to retry with simpler parameters
- Offer manual test creation as fallback
Save Errors
- Show error details
- Offer to retry
- Offer to save as draft for later
State Persistence
Store wizard state in session memory:
{
"currentStep": 5,
"collectedData": {
"name": "login_validation",
"description": "...",
"environment": { "id": "...", "name": "..." },
"testData": [...],
"tags": [...],
"scenarios": "...",
"count": 8,
"complexity": "medium"
},
"generatedTests": [...],
"reviewState": {
"editedTests": [...],
"selectedForSave": ["1", "2", "3"]
}
}Authoring standard
When creating or editing Gherkin, follow references/contract.md. The full writing guide, Gherkin dialect, and casebook live in references/ (generated from docs.testzeus.com). Do not invent a dialect or download docs at runtime.
Examples
See examples/conversation.md for detailed examples.
Related Skills
- testzeus-test-blocks - Step-based Test Blocks tests (not Gherkin)
- testzeus-test-operations - For running and managing tests after creation
- testzeus-reports - For analyzing test results
- testzeus-dashboards - For monitoring test health
Context-backed Gherkin, Enrich and Magic Test
Do not force Magic Test or coverage-planning requests through the legacy
single-test wizard. First call get_authoring_context and resolve the actual
application/environment plus relevant tenant data and knowledge references.
For Salesforce, ServiceNow, SAP and Oracle use the user's documented workflows
and fields; never invent objects/permissions or claim connected metadata was
inspected unless a tool returned it.
For manual Gherkin, use explicit Given/When/Then setup, action and assertions;
use test-data variables instead of secrets. create_test supports selected
knowledge_base_ids and hypermind_code_blocks in addition to environment/data/tags.
After saving, enrich_test invokes the real UIX enrichment endpoint. Poll the
returned activity with get_authoring_activity and inspect the resulting test.
For a new smoke/coverage/edge-case batch, create_magic_tests does not require
an existing test. Select environment, data, knowledge IDs and tags; omit count
for Auto. Plan happy path, negative validation, boundaries, permissions,
integration failures and recovery based on the specific workflow. Get explicit
confirmation before submission, then poll get_magic_test_generation; do not
present submitted/processing as completed test generation. Mobile requires an
environment. Flow-driven generation is opt-in and must match the actual app.