> ## Documentation Index
> Fetch the complete documentation index at: https://onetest.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Management

> Create, organize, and manage your test cases

## Overview

OneTest's test management system helps you create, organize, track, and maintain your test cases efficiently.

<CardGroup cols={3}>
  <Card title="Test Cases" icon="file-lines">
    Create and manage test cases with steps, preconditions, and expected results
  </Card>

  <Card title="Folders & Tags" icon="folder-tree">
    Organize tests hierarchically with folders and categorize them with tags
  </Card>

  <Card title="OQL Search" icon="magnifying-glass">
    Find tests instantly with a powerful query language
  </Card>
</CardGroup>

## Creating Test Cases

There are multiple ways to create test cases in OneTest.

<Tabs>
  <Tab title="AI Generation (Recommended)">
    ### Generate Tests with AI

    The fastest way to create tests is using the AI Assistant:

    <Steps>
      <Step title="Open AI Chat">
        Press `Cmd/Ctrl + K` or click the chat icon
      </Step>

      <Step title="Describe What to Test">
        ```
        Create a test for user login with valid credentials
        ```
      </Step>

      <Step title="Review & Save">
        The AI generates a complete test case. Review and click **Save**.
      </Step>
    </Steps>

    <Tip>
      The AI understands context and can generate multiple related tests at once:

      ```
      Create 5 tests for the checkout flow covering happy path and error cases
      ```
    </Tip>
  </Tab>

  <Tab title="Manual Creation">
    ### Manual Test Creation

    <Steps>
      <Step title="Click New Test">
        Navigate to Test Management and click **"+ New Test"**
      </Step>

      <Step title="Fill Basic Information">
        * **Title**: Clear, descriptive title
        * **Description**: What this test validates
        * **Priority**: P0 (critical) to P4 (nice-to-have)
        * **Type**: Manual, Automated, or API
      </Step>

      <Step title="Add Test Steps">
        Define step-by-step instructions:

        1. Action to perform
        2. Expected result
      </Step>

      <Step title="Set Metadata">
        * **Tags**: `smoke`, `regression`, `login`, etc.
        * **Folder**: Organize by feature area
        * **Requirements**: Link to user stories (e.g., `US-123`)
      </Step>

      <Step title="Save">
        Click **Save** to create the test case
      </Step>
    </Steps>
  </Tab>

  <Tab title="Import from File">
    ### Import Tests

    <Steps>
      <Step title="Prepare Your File">
        Supported formats: CSV, Excel, or JSON
      </Step>

      <Step title="Click Import">
        Go to Test Management and click **Import**
      </Step>

      <Step title="Map Fields">
        Map your columns to OneTest fields
      </Step>

      <Step title="Review & Import">
        Review the preview and click **Import**
      </Step>
    </Steps>

    See [Import & Export](/ui/import-export) for details.
  </Tab>
</Tabs>

## Test Case Components

<AccordionGroup>
  <Accordion title="Title & Description" icon="heading">
    **Title**: Short, clear summary of what's being tested

    ```
    Good: "Verify user can login with valid credentials"
    Bad:  "Login test"
    ```

    **Description**: Detailed explanation of the test purpose and scope
  </Accordion>

  <Accordion title="Test Steps" icon="list-ol">
    Each step should have:

    * **Action**: What the tester should do
    * **Expected Result**: What should happen

    Example:

    ```
    1. Navigate to login page       → Login form is displayed
    2. Enter valid username          → Username field accepts input
    3. Enter valid password          → Password is masked
    4. Click Login button            → User is redirected to dashboard
    ```
  </Accordion>

  <Accordion title="Preconditions" icon="circle-check">
    What must be true before running this test:

    * User account exists
    * User is not logged in
    * Test data is available
  </Accordion>

  <Accordion title="Test Data" icon="database">
    Specific data needed for this test:

    * Username: `test@example.com`
    * Password: `Test123!`
    * Expected role: `Admin`
  </Accordion>

  <Accordion title="Tags & Folders" icon="tags">
    **Tags**: Categorize for easy filtering

    * `smoke`: Critical path tests
    * `regression`: Run before releases
    * `feature-name`: Group by feature

    **Folders**: Hierarchical organization

    * Authentication/Login/Valid Credentials
    * Checkout/Payment/Credit Card
  </Accordion>
</AccordionGroup>

## Organizing Tests

### Folders

Create folders to organize tests by feature, module, or any structure that fits your team:

<Steps>
  <Step title="Navigate to Test Management">
    Access the Test Management section from the main navigation
  </Step>

  <Step title="Create Folders">
    Create folders to organize your tests by feature or module
  </Step>

  <Step title="Move Tests">
    Drag and drop or use bulk operations to move tests into folders
  </Step>
</Steps>

### Bulk Operations

Use checkboxes to select test cases for bulk actions:

* **Click a checkbox** to select a single test
* **Select multiple** tests across the list
* **Bulk actions** appear in the toolbar: Move, Tag, Export

## Exporting Test Cases

Export test cases to **Excel (XLSX)** format for reporting, sharing, or offline review.

<Tabs>
  <Tab title="Export All">
    Export all test cases in the current product:

    1. Go to the Test Cases list
    2. Click the **Export** button in the toolbar
    3. Choose **"All Test Cases"**
    4. An XLSX file downloads with all test data
  </Tab>

  <Tab title="Export with OQL Filter">
    Export a filtered subset using OQL:

    1. Enter an OQL query in the search bar (e.g., `priority IN (p1, p2) AND status = ready`)
    2. Click the **Export** button
    3. Choose **"Filtered Results"**
    4. Only matching test cases are exported
  </Tab>

  <Tab title="Export Selected">
    Export specific test cases:

    1. Select test cases using checkboxes
    2. Click the **Export** button
    3. Choose **"Selected Tests"**
    4. Only checked test cases are exported
  </Tab>

  <Tab title="Export Unassigned">
    Export test cases not assigned to any folder:

    1. Click the **Export** button
    2. Choose **"Unassigned Tests"**
    3. Tests without a folder are exported
  </Tab>
</Tabs>

### XLSX Export Contents

The exported Excel file includes:

| Column        | Description                        |
| ------------- | ---------------------------------- |
| Identifier    | TC-0001, TC-0002, etc.             |
| Title         | Test case title                    |
| Type          | manual, automated, exploratory     |
| Status        | draft, ready, deprecated, archived |
| Priority      | p1, p2, p3, p4                     |
| Description   | Full description text              |
| Preconditions | Setup requirements                 |
| Steps         | Action and expected result pairs   |
| Tags          | Comma-separated tags               |
| Folder        | Folder path                        |
| Created       | Creation date                      |
| Updated       | Last modification date             |

## Best Practices

<CardGroup cols={2}>
  <Card title="Be Specific" icon="bullseye">
    Clear, unambiguous steps that anyone can follow
  </Card>

  <Card title="Single Purpose" icon="crosshairs">
    One test case should verify one thing
  </Card>

  <Card title="Use Tags" icon="tag">
    Tag appropriately for easy filtering and test suite creation
  </Card>

  <Card title="Link Requirements" icon="link">
    Connect tests to user stories or requirements for traceability
  </Card>
</CardGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="Running Tests" icon="play" href="/ui/running-tests">
    Execute and monitor test runs
  </Card>

  <Card title="Import & Export" icon="file-export" href="/ui/import-export">
    Bulk import and export test cases
  </Card>

  <Card title="AI Assistant" icon="sparkles" href="/ai/generate-tests">
    Generate tests with AI
  </Card>

  <Card title="OQL Query Language" icon="code" href="/oql/overview">
    Master OQL for powerful searches
  </Card>
</CardGroup>
