# Import existing tests

If your team already has Gherkin feature files, you can import them into a TestVibe group instead of recreating them by hand.

Imported features become part of the Test Suite and can be edited, generated, and run like other TestVibe tests.

## What To Import

The clearest import path is `.feature` files written in Gherkin.

Good import candidates:

| File                           | Why                                                            |
| ------------------------------ | -------------------------------------------------------------- |
| `Login.feature`                | Contains readable `Feature` and `Scenario` sections.           |
| `Checkout.feature`             | Describes user behavior that can become Playwright automation. |
| `Admin/UserManagement.feature` | Already grouped by product area.                               |

If you already have Playwright code, connect the repository first and review how the files appear in the Test Suite. The group import flow is focused on feature files.

## Import Into A Group

1. Open the **Test Suite**.
2. Select the group where the feature files belong.
3. Choose **Import feature files**.
4. Select one or more `.feature` files.
5. Wait for TestVibe to add them to the group.
6. Review the imported features.

You may also be able to drag `.feature` files onto the group feature list when a group is selected.

## What Happens During Import

TestVibe creates feature files in the selected group. It keeps the imported Gherkin content and uses the file names as part of the repository path.

For example:

| Selected group | Imported file              | Resulting location                          |
| -------------- | -------------------------- | ------------------------------------------- |
| `Auth`         | `Login.feature`            | `Features/Auth/Login.feature`               |
| `Billing`      | `Invoice Download.feature` | `Features/Billing/Invoice Download.feature` |

If a file name conflicts with an existing feature, choose a clearer name before importing or rename the existing feature.

## Review After Import

After importing, open each feature and check:

| Review       | Why it matters                                             |
| ------------ | ---------------------------------------------------------- |
| Feature name | It should match the behavior being tested.                 |
| Scenarios    | Each scenario should be focused and testable.              |
| Steps        | Steps should use visible UI details and expected outcomes. |
| Background   | Shared setup should apply to every scenario.               |
| Test data    | Data should exist or be created during the test.           |

Imported Gherkin may need cleanup before AI generation.

## Common Cleanup

* split very long scenarios
* replace vague steps with visible actions and results
* remove implementation notes that are not user behavior
* add missing `Then` assertions
* move repeated setup into `Background`
* update old labels or page names to match the current app

## Next

Improve imported content with [Write good test instructions](/create-tests/write-good-test-instructions.md), then generate code with [Generate Playwright code](/ai-generation/generate-playwright-code.md).


---

# 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/import-existing-tests.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.
