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

# Extend test coverage

> Bugzy explores your application, creates structured test plans, and generates Playwright test automation — covering critical user flows and edge cases.

Test planning, test analysis, test design, and test implementation — Bugzy covers the full test creation lifecycle. It explores your application, understands its features, and writes comprehensive tests, acting as a QA teammate who handles the heavy lifting of building and maintaining test coverage. The process runs in two phases: first a structured test plan, then executable test cases with automated Playwright scripts.

## Phase 1: Test plan

The `generate-test-plan` task takes a product description and produces a comprehensive test plan.

**Inputs:**

* Product description (from dashboard)
* Live application (Bugzy explores with a real browser)
* Existing project context and docs

**Process:**

<Steps>
  <Step title="Browser exploration">
    The browser-automation subagent opens your app and systematically navigates pages, forms, and flows.
  </Step>

  <Step title="Cross-reference with product description">
    Bugzy compares what it finds in the live app with the product description you provided.
  </Step>

  <Step title="Identify test scenarios">
    Happy paths, edge cases, error states, and boundary conditions are catalogued.
  </Step>

  <Step title="Pull product specs">
    If Notion or Jira is connected, the documentation-researcher subagent pulls product specs for additional context.
  </Step>

  <Step title="Generate test plan">
    A structured test plan is generated and committed to the repo.
  </Step>
</Steps>

**Output:** `test-plan.md` — a markdown document with test areas, scenarios, and expected behaviors.

**Test plan structure:**

| Element          | Description                                                                 |
| ---------------- | --------------------------------------------------------------------------- |
| Test areas       | Logical groupings of related functionality (e.g., Authentication, Checkout) |
| Scenarios        | Individual test scenarios within each area                                  |
| Expected results | What should happen when the scenario is executed                            |
| Priority levels  | Critical, High, Medium, Low                                                 |
| Tags             | `@smoke`, `@regression`, `@edge-case`                                       |

## Phase 2: Test cases and automation

The `generate-test-cases` task converts the test plan into two artifact types.

### Manual test case documents

Located in `test-cases/TC-XXX.md`, each document includes:

* Preconditions
* Numbered steps
* Expected results
* Test data

### Automated Playwright scripts

Located in `tests/specs/*.spec.ts`, each script follows these conventions:

* TypeScript with Page Object patterns
* Proper waits and assertions
* Environment variables for secrets
* `@smoke` and `@regression` tags

<Steps>
  <Step title="Read test plan">
    The agent reads the test plan and identifies testable scenarios.
  </Step>

  <Step title="Generate Playwright files">
    The test-engineer subagent generates Playwright test files area by area.
  </Step>

  <Step title="Create Page Objects">
    Shared interactions are extracted into reusable Page Object classes.
  </Step>

  <Step title="Validate against live app">
    Tests are run against the live application to verify they pass.
  </Step>

  <Step title="Auto-fix failures">
    Failing tests are automatically fixed — selectors updated, timing adjusted.
  </Step>

  <Step title="Commit artifacts">
    All artifacts are committed to the repo.
  </Step>
</Steps>

## Output artifacts

| Artifact           | Location                | Description                                       |
| ------------------ | ----------------------- | ------------------------------------------------- |
| Test plan          | `test-plan.md`          | Structured markdown with test areas and scenarios |
| Manual test cases  | `test-cases/TC-XXX.md`  | Step-by-step test case documents                  |
| Automated tests    | `tests/specs/*.spec.ts` | Playwright TypeScript test scripts                |
| Page Objects       | `tests/pages/*.ts`      | Reusable page interaction classes                 |
| Test config        | `tests/CLAUDE.md`       | Framework conventions and execution commands      |
| Test data template | `.env.testdata`         | Non-secret test data values                       |

## Browser exploration

The browser-automation subagent uses Playwright CLI to explore your application:

* Navigates the base URL and crawls pages
* Interacts with forms, buttons, and dropdowns
* Takes screenshots of each page
* Identifies dynamic content, auth walls, and multi-step flows

Exploration is bounded by the base URL domain — Bugzy does not navigate to external sites.

## Knowledge base

During test generation, the agent builds a `knowledge-base.md` file that captures:

* Application structure and navigation
* Common selectors and interaction patterns
* Authentication flows
* Flaky areas and environment-specific behaviors

This knowledge base is consulted in future runs, so Bugzy's understanding of your application improves over time.
