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

# Label Playwright failures with defect types

> Label failed and flaky Playwright test cases with your team's own defect types, one at a time or by error group, then filter a test run by them.

Defect types are labels your team defines for why a test case failed, such as **Product bug**, **Automation bug**, or **Environment issue**. Label failed and flaky test cases in a test run, one at a time or a whole error group at once, then filter the run and see how much of it is triaged.

Each project has its own defect types. They are separate from [failure classification](/glossary#failure-classification), the AI category TestDino assigns to every failure. A test case can carry both.

<Note>
  Defect types require the **Pro** plan or above. On the Free plan, labels already on your test runs stay visible, and new labels cannot be added. See [Pricing](/pricing).
</Note>

## Quick Reference

| Topic | Link | Best for |
| :- | :- | :- |
| Set up labels | [Create defect types](#create-defect-types) | First-time setup by an owner or administrator |
| One test case | [Label a test case](#label-a-test-case) | Triage from the Summary tab or the test case page |
| Many test cases | [Label an error group](#label-an-error-group) | Labelling every test case that hit the same error |
| Context | [Add a reason](#add-a-reason) | Recording why this label applies |
| Triage progress | [Filter a test run by defect type](#filter-a-test-run-by-defect-type) | Seeing what is triaged and what is left |
| Housekeeping | [Manage defect types](#manage-defect-types) | Editing, archiving, or deleting a label |
| Access | [Roles and permissions](#roles-and-permissions) | Who can label and who can manage |

## Create defect types

A new project has no defect types. An owner or administrator adds them from the **Defect Types** sheet, which opens from any test run:

* Open a defect type picker on a failed or flaky test case and click **Manage defect types** at the bottom.
* Or, on the Summary tab, click the settings icon on the **Defect types** card. The card appears once the test run has at least 1 label.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/guides/debug-failures/defect-types/defect-types-sheet.webp" alt="Defect Types sheet listing active defect types with color chips, usage counts, and descriptions, with the Add Defect Type button and the active count in the header" />

Click **Add Defect Type** and fill in the form:

| Field | Required | Limit | Notes |
| :- | :- | :- | :- |
| **Name** | Yes | 40 characters | Unique among active defect types in the project |
| **Color** | Yes | | Pick a swatch. The chip preview updates as you choose. |
| **Description (optional)** | No | 200 characters | When your team uses this label. Shown in the sheet and searchable. |

<img src="https://tdstorageus.blob.core.windows.net/public/docs/guides/debug-failures/defect-types/defect-types-sheet-create.webp" alt="Add Defect Type form with the Name field, the color swatches with a live chip preview, and the optional Description field" />

A project holds up to 20 active defect types. The sheet header shows the count, for example `5 of 20 active`. Archived defect types do not count toward the limit.

**Create from the picker.** Owners and administrators can also type a new name into the picker search and click `Create "<name>"`. The defect type is created with the next free color and applied in the same step. Add a description later from the sheet.

## Label a test case

Labels go on failed and flaky test cases in a finished test run. The control appears once TestDino has finished processing the run.

| Where | Control |
| :- | :- |
| Test run **Summary** tab | A **Label** button on each failed or flaky row, next to the AI category badge |
| Test run **Errors** tab | A **Label** button on each test case row inside an expanded error group |
| Test case page | **Set defect type** in the **Status** card |

Click the control, search, and pick a defect type. The chip updates right away and shows the label everywhere that test case appears in the run.

To change a label, open the chip and pick another defect type. To remove it, open the chip and click **Clear defect type**.

## Label an error group

On the **Errors** tab, each error group has a **Label group** button. Picking a defect type labels every failed and flaky test case in the group, including test cases that already had a different defect type.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/guides/debug-failures/defect-types/errors-label-group.webp" alt="Errors tab with an expanded error group and its Label group picker open, listing the project's defect types" />

A toast confirms the result, for example `Labelled 12 tests as Product bug.`, with an **Undo** action that puts every test case back to the label it had before.

The group button shows the group's current state:

| Button shows | Meaning |
| :- | :- |
| **Label group** | No test case in the group is labelled yet |
| A defect type chip | Every labelled test case in the group has that defect type |
| **Mixed** | Test cases in the group have 2 or more different defect types |

When a large group shows only `Showing the first N of M tests with this error`, a group label goes only on test cases that have no label yet. Test cases that already have a defect type keep it.

The **Label group** button is hidden while a search or tag filter is active on the Errors tab. Clear the filter to label the whole group.

## Add a reason

A reason is a short note on 1 test case that explains why its label applies, for example `Checkout API returns 500 since the deploy on Monday`.

1. Open the test case's chip and click **Add reason**.
2. Enter up to 2,000 characters and click **Save Reason**.

The chip shows a note icon, and the reason appears in the chip's tooltip wherever the label shows. Use **Edit reason** to change it.

A reason belongs to its defect type. When you pick a different defect type for a test case that has a reason, TestDino asks for a new reason and shows the previous one for reference. Leave it empty to change the label without a reason. Labelling an error group also replaces the reasons on the test cases it changes, and **Undo** brings them back.

## Filter a test run by defect type

Once a test run has at least 1 label, the Summary tab shows a **Defect types** card above **Detailed Analysis**:

* A bar that splits the run's failed and flaky test cases by defect type, with **Not triaged** last.
* A progress line, such as `75% triaged · 3 left`, or `All 12 tests triaged` when nothing is left.
* A legend chip per defect type. Click a chip to filter the table to that defect type.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/guides/debug-failures/defect-types/summary-defect-types-card.webp" alt="Defect types card on the Summary tab showing a stacked bar by defect type, the percent triaged with the number left, and legend chips including Not triaged" />

The **Defect type** filter in the Summary tab's filter menu does the same. It lists each defect type used in the run with its count, for example `Product bug (4)`, plus `Not triaged (3)` for failed and flaky test cases with no label yet. Use **Not triaged** as your triage queue.

## Manage defect types

Owners and administrators manage defect types from the **Defect Types** sheet. Each row's actions menu offers:

| Defect type | Actions |
| :- | :- |
| Active, used on a test run | **Edit**, **Archive** |
| Active, never used | **Edit**, **Delete** |
| Archived | **Restore**, plus **Delete** if it was never used |

* **Edit** renames it, changes its color, or updates its description. A rename updates the label on every test run, including past ones.
* **Archive** removes it from the pickers so nobody applies it again. Labels already on test runs stay visible. Archived defect types are listed under **Archived** in the sheet and free a slot toward the limit.
* **Restore** makes an archived defect type available in the pickers again.
* **Delete** removes a defect type that was never used. It cannot be undone. A defect type that has been used can only be archived.

## Roles and permissions

| Action | Owner | Administrator | Member | Viewer | Billing Manager |
| :- | :-: | :-: | :-: | :-: | :-: |
| See labels, the Defect types card, and the filter | ✅ | ✅ | ✅ | ✅ | ✅ |
| Label, change, or clear a test case or error group | ✅ | ✅ | ✅ | ❌ | ❌ |
| Add or edit a reason | ✅ | ✅ | ✅ | ❌ | ❌ |
| Create, edit, archive, restore, or delete defect types | ✅ | ✅ | ❌ | ❌ | ❌ |

Members see **No defect types yet** in the picker until an owner or administrator adds some. Full role details are in [Users & Roles](/platform/organizations/users-roles).

## Troubleshooting

<AccordionGroup>
  <Accordion title="The Label button does not appear">
    Labels go only on failed and flaky test cases in a finished test run. The control is hidden while the run is still in progress, on a run with no failed or flaky test cases, and for a short time after the run finishes while TestDino processes it. On the Free plan, it is hidden on test cases that have no label.
  </Accordion>

  <Accordion title="This run is still being processed. Try again in a moment.">
    The test run finished moments ago and TestDino is still processing its results. Wait a few seconds and apply the label again.
  </Accordion>

  <Accordion title="This project has reached its defect type limit. Archive one to add another.">
    The project already has 20 active defect types. Archive one you no longer use from the **Defect Types** sheet, then add the new one.
  </Accordion>

  <Accordion title="A defect type with this name already exists.">
    Another active defect type in the project uses that name. Pick a different name, or rename or archive the existing one first.
  </Accordion>

  <Accordion title="This defect type is used on runs, so it can only be archived.">
    A defect type that has labelled any test case cannot be deleted. Archive it instead: it leaves the pickers and its labels stay on past test runs.
  </Accordion>

  <Accordion title="Every test in this group already has a type.">
    Every test case in the error group already carries the defect type you picked, so nothing changed.
  </Accordion>

  <Accordion title="This error group is too large to label at once.">
    The group holds more test cases than a single group label can change. Label test cases from their rows, or narrow the group with search first.
  </Accordion>

  <Accordion title="You need at least member access to perform this action">
    Your role is Viewer or Billing Manager, which can see labels but not set them. Ask an owner or administrator to change your role.
  </Accordion>

  <Accordion title="Defect types are available on Pro">
    The organization is on the Free plan. Labels already on your test runs stay visible. Click **Upgrade to Pro** to add and apply defect types.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Run Summary" icon="clipboard-list" href="/platform/test-runs/playwright-failure-summary">
    Failed, flaky, and skipped test cases in a test run.
  </Card>

  <Card title="Errors tab" icon="triangle-exclamation" href="/platform/playwright-test-runs/errors">
    A test run's failures grouped by error message.
  </Card>

  <Card title="Error grouping" icon="layer-group" href="/guides/playwright-error-grouping">
    How TestDino groups failures by root cause.
  </Card>

  <Card title="Users & Roles" icon="users" href="/platform/organizations/users-roles">
    What each role can do in a project.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.