You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,6 +195,34 @@ Download specific tests based on their id on the Rainforest dashboard
195
195
rainforest download 33445 11232 1337
196
196
```
197
197
198
+
#### Generating Tests with AI
199
+
200
+
Generate a new test using AI based on a natural language prompt. `--title` and `--platform` are required. Commonly used platforms include: `windows10_chrome`, `windows11_chrome`, and `windows11_chrome_fhd`; unsupported values will be rejected by the Rainforest API. Note: AI test generation only supports one platform at a time.
201
+
202
+
```bash
203
+
rainforest generate "Log in with valid credentials and verify the dashboard loads" --title "Login Flow" --start-uri /login --platform windows11_chrome
204
+
```
205
+
206
+
You can also use a full URL instead of a start URI.
207
+
208
+
```bash
209
+
rainforest generate "Add an item to the shopping cart" --title "Add to Cart" --url https://example.com/shop --platform windows11_chrome
210
+
```
211
+
212
+
Provide credentials information for the AI to use during test generation. This is a free-form string passed to the AI model.
213
+
214
+
```bash
215
+
rainforest generate "Log in as admin user" --title "Admin Login" --start-uri /admin --platform windows11_chrome --credentials "username: admin, password: secret123"
216
+
```
217
+
218
+
Alternatively, use a login snippet for authentication.
Description: "Generate a new Rainforest test using AI based on a natural language prompt. "+
369
+
"The prompt should describe what the test should do. "+
370
+
"Example: rainforest generate \"Log in with valid credentials and verify the dashboard loads\"",
371
+
Flags: []cli.Flag{
372
+
cli.StringFlag{
373
+
Name: "title",
374
+
Usage: "Title for the generated test.",
375
+
},
376
+
cli.StringFlag{
377
+
Name: "start-uri",
378
+
Usage: "The starting `URI` path for the test (e.g., /login).",
379
+
},
380
+
cli.StringFlag{
381
+
Name: "url",
382
+
Usage: "The full starting `URL` for the test (alternative to --start-uri).",
383
+
},
384
+
cli.StringFlag{
385
+
Name: "platform",
386
+
Usage: "Specify the `PLATFORM` to use for AI generation (e.g., windows10_chrome, windows11_chrome).",
387
+
},
388
+
cli.IntFlag{
389
+
Name: "environment-id",
390
+
Usage: "The `ENVIRONMENT-ID` to use for the test.",
391
+
},
392
+
cli.StringFlag{
393
+
Name: "credentials",
394
+
Usage: "Free-form credentials information to pass to the AI for test generation (e.g., \"username: admin, password: secret123\"). This is an opaque string passed to the AI model. Mutually exclusive with --login-snippet-id.",
395
+
},
396
+
cli.IntFlag{
397
+
Name: "login-snippet-id",
398
+
Usage: "The `ID` of a snippet to use for login steps. Mutually exclusive with --credentials.",
0 commit comments