> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/core-features/intelligence-hub/generate-test-cases/scripts-script-to-test-case-conversion.md).

# Scripts (Script-to-Test Case Conversion)

**When to Use Script-to-Test Case Conversion:**\
Use this feature when you have existing automation test scripts and want to automatically convert them into structured, execution-ready test cases within Walnut.

* **Supported Scripts:** Playwright (.ts, .js, .spec.ts, .spec.js)

#### **Steps to Generate:**

* **Select Scripts:** Click the **Scripts** option under the **Generate Test Cases** section.

<figure><img src="/files/mj3aqb4HgzGPg4DD3fZV" alt=""><figcaption></figcaption></figure>

* **Upload:** Drag and drop Playwright script files or click **Upload** to select script files from your local device.

<figure><img src="/files/mj3aqb4HgzGPg4DD3fZV" alt=""><figcaption></figcaption></figure>

* Click **Analyse Scripts** to allow Walnut AI to process the uploaded files.

<figure><img src="/files/QcmOcfXNRCUvPoD2MazZ" alt=""><figcaption></figcaption></figure>

* **AI Analysis:** Walnut AI analyses the uploaded scripts to extract step definitions, step-level actions, assertions (automatically converted into validations), and variables (converted into parameters where applicable).

<figure><img src="/files/XO4OkW6UHUKHPKGisac6" alt=""><figcaption></figcaption></figure>

* **Review & Refine:** Review the generated test cases and refine them using the **Walnut AI Chatbot** to enhance steps, validations, and scenarios if required.

<figure><img src="/files/v1XjBpttZ2Q3hNgslVtI" alt=""><figcaption></figcaption></figure>

* **Save:** Click **Save** to store the generated test cases in the system.

<figure><img src="/files/F3vjEzBFIVEpawiixOx0" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Result:** Saved **Test Cases** will appear in the **Test Case Module** reflected accordingly.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.walnutai.ai/core-features/intelligence-hub/generate-test-cases/scripts-script-to-test-case-conversion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
