# Test Case Properties

Beyond the step-by-step scenario, a test case can carry metadata that helps you organize and navigate your test suite: tags, environments, external links, and file attachments.

## Tags

Tags are free-form labels you add to a test case for filtering and organization. Unlike Priority and Status (which are dedicated fields with fixed values), tags are entirely user-defined.

Common patterns:

- **Feature area**: `login-flow`, `checkout`, `payment`, `search`
- **Scope**: `smoke`, `regression`, `edge-case`
- **Platform**: `mobile`, `desktop`, `web`, `ios`, `android`
- **Team**: `team-auth`, `team-payments`

In the test case editor, scroll to the **Tags** section and type a tag name. Use hyphens instead of spaces: `smoke-test`, not `smoke test`.

In Markdown:

```markdown
tags:
  - smoke
  - regression
  - login-flow
```

## Environments

Environments let you specify which infrastructure or configuration a test case targets. Where tags describe *what* is being tested, environments describe *where*: the deployment target, browser, device, or any runtime condition that affects how the test runs.

Common patterns:

- **Deployment stage**: `staging`, `production`, `dev`, `qa`
- **Browser**: `chrome`, `firefox`, `safari`, `edge`
- **Platform**: `ios`, `android`, `linux`, `windows`
- **Data set**: `empty-db`, `seeded`, `migrated`

In the test case editor, scroll to the **Environment** section and type a value. Multiple environments can be added to the same test case.

In Markdown:

```markdown
environment:
  - staging
  - chrome
```

### Tags and environments in test runs

Test-case tags and environments describe the case. A test run has its own single set of tags and environments, shown in the run header. When creating a run, enabling **Tags** or **Environment** collects the union of those values from the selected cases and stores it on the run; the values are not repeated in each case section.

## Links

Links connect a test case to external resources such as bug tracker tickets or documentation pages, or to files in your project such as a specification.

Each link has an optional **Title** and a required **Target**: a web URL or a path to a project file. Click **Add link** in the preview and fill in the fields, or edit the Markdown directly:

```markdown
Links:

[TICKET-123: Login requirements](https://tracker.example.com/TICKET-123)
[API docs](https://docs.example.com/auth)
[openspec/specs/auth/spec.md](../../openspec/specs/auth/spec.md)
```

To link a project file, click the browse button in the **Target** field and pick the file. SpeQA writes the path relative to the test case and, if **Title** is empty, fills it with the path from the project root. If a typed path does not lead to a project file, the dialog warns you but still lets you save the link.

The icon in front of a link shows where it leads:

- the chain icon marks a web link;
- the file type icon, for example the Markdown icon, marks a project file;
- a warning icon marks a file that is not found or a link that cannot be opened; hover it to see the reason.

Links are useful for tracing which requirement or bug report a test case covers, and for navigating directly to the relevant ticket from within the IDE.

Clicking a link in the preview opens it as follows:

- A web address (`https://...`, or an address typed without a scheme such as `tracker.example.com/TICKET-123`) opens in the browser.
- A path relative to the test case file, such as `../../openspec/specs/auth/spec.md`, opens that file in the IDE when it exists inside the project. Paths that lead outside the project are not opened.
- Other schemes, such as `file:` or `ftp:`, are ignored.

When a test run imports links, relative paths are adjusted so they still point to the same files from the run's folder.

## Attachments

Attachments are files stored alongside the test case - screenshots, logs, design documents, or anything else relevant to the test.

Drag a file onto the attachments area in the preview, or click **Attach file**. SpeQA copies the file into an `attachments/` folder next to the test case and records the relative path in the Markdown.

Step-level attachments work the same way and are attached to a specific step rather than the test case as a whole.
