# Manage generated test files

TestVibe stores test intent and generated automation in your GitHub repository.

Feature files are the readable source of truth. Generated Playwright files are the executable output.

## Main File Types

| File type                      | Purpose                                                |
| ------------------------------ | ------------------------------------------------------ |
| `.feature`                     | Readable Gherkin test intent.                          |
| `.js` or `.ts` Playwright test | Generated browser automation that can be run.          |
| Playwright configuration       | Browser, viewport, reporter, and execution settings.   |
| TestVibe settings              | Project defaults such as framework, agent, and runner. |

Most users should edit `.feature` files first and let TestVibe generate the Playwright code.

## Where Files Live

Feature files usually live under `Features/`.

Example structure:

```
Features/
  Auth/
    Login.feature
    Login.js
  Billing/
    DownloadInvoice.feature
    DownloadInvoice.js
Configurations/
  Default.config.js
```

Your repository may use `.ts` instead of `.js` depending on project setup.

## How Names Affect Paths

Group and feature names influence repository paths.

| TestVibe action               | Repository effect                                                   |
| ----------------------------- | ------------------------------------------------------------------- |
| Create group `Auth`           | Creates or uses `Features/Auth/`.                                   |
| Add feature `Login` in `Auth` | Creates `Features/Auth/Login.feature`.                              |
| Rename feature                | Renames the feature file.                                           |
| Move feature                  | Moves the feature file to another group folder.                     |
| Generate code                 | Creates or updates the Playwright file associated with the feature. |

Use clear names early. Renaming later is supported when available, but it changes repository paths.

## Regenerate Or Edit

| Situation                                     | Recommended action                                  |
| --------------------------------------------- | --------------------------------------------------- |
| The behavior changed                          | Edit the `.feature` file and regenerate.            |
| The expected outcome changed                  | Edit the `.feature` file and regenerate.            |
| The generated code has a small selector issue | Edit code or improve Gherkin and regenerate.        |
| The code uses the wrong journey               | Improve the Gherkin and regenerate.                 |
| The test uses a shared helper                 | Edit generated code if your team owns that pattern. |

Regeneration may replace manual code changes. If you manually edit generated code, make sure your team knows which changes should be preserved.

## Keep Files Reviewable

* Keep feature names aligned with user behavior.
* Keep generated files near their source feature when possible.
* Review generated code before relying on it for important flows.
* Run one test after generation before running a whole group.
* Update Gherkin when product behavior changes.

## If Files Look Missing

Check:

* the selected repository and branch
* whether generation completed successfully
* whether the feature is under the expected group
* whether the generated code tab is available for the selected feature
* whether the workflow had permission to commit generated output

See [Troubleshoot failed generation](/ai-generation/troubleshoot-failed-generation.md) if generation did not finish.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testvibe.com/create-tests/manage-generated-test-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
