# Edit Test Content

URL: https://docs.testvibe.com/create-tests/edit-test-content

You can edit test intent and, when needed, generated code from the selected feature detail view.

![The feature detail Gherkin editor](/assets/images/feature-editor-c1a99cf849c7edd619a123eae538f6ee.png)

Most changes should start in the Gherkin feature file. Regenerate Playwright code after the intent changes meaningfully.

## Edit Gherkin Intent

Use the Gherkin editor when you want to change what the test should prove.

1. Open the **Test Suite** .
2. Select a feature.
3. Open the editor for the feature file.
4. Update the `Feature` , `Background` , `Scenario` , or steps.
5. Save the file.
6. Regenerate Playwright code if the behavior changed.
Saving writes the updated `.feature` file to your project.

## Save Options

Depending on the screen, you may see options such as:

| Option | Use it when | Save | You want to keep editing or review before generating. | Save and close | You are done editing the feature for now. | Save and generate | You want to save the current feature and immediately start generation. | Cancel or revert | You do not want to keep unsaved edits. 

If you have unsaved changes, TestVibe may ask before switching away from the editor.

## Edit Generated Code

Generated Playwright code is executable test code. Edit it only when you need a targeted adjustment that is easier to make in code than in Gherkin.

Good reasons to edit generated code:

| Reason | Example | Small selector fix | A generated locator needs a more stable role or label. | Extra wait or assertion | The app has a known delayed state that should be verified. | Project-specific helper | Your project has a reusable test helper. 

Prefer editing Gherkin and regenerating when the expected behavior changed.

## Regenerate Or Edit Manually?

| Situation | Better choice | The user journey changed | Edit Gherkin, then regenerate. | The expected result changed | Edit Gherkin, then regenerate. | A selector is slightly wrong | Edit generated code or improve Gherkin with visible labels. | The generated code is broadly off | Improve Gherkin and regenerate. | A helper should be reused | Edit generated code if your team owns that helper pattern. 

## After Editing

After saving changes:

1. Generate or regenerate Playwright code if needed.
2. Run one test first.
3. Review screenshots, videos, traces, and failure details.
4. Keep the Gherkin and code aligned.

## Related Pages

- [Write good test instructions](/create-tests/write-good-test-instructions)
- [Regenerate a test](/ai-generation/regenerate-test)
- [Manage generated test files](/create-tests/manage-generated-test-files)
