Skip to content

[WIP] RF-39249 Add AI Test Generation Command#500

Open
sebaherrera07 wants to merge 2 commits intomasterfrom
RF-39249-support-ai-test-generation
Open

[WIP] RF-39249 Add AI Test Generation Command#500
sebaherrera07 wants to merge 2 commits intomasterfrom
RF-39249-support-ai-test-generation

Conversation

@sebaherrera07
Copy link
Member

@sebaherrera07 sebaherrera07 commented Feb 3, 2026

WIP: still have to test it locally

Introduces AI-powered test generation to the Rainforest CLI, allowing users to create tests using natural language prompts.

New Commands

rainforest generate - Generate a new test from a natural language prompt

  • rainforest generate "Log in with valid credentials" --start-uri /login

Key Features

  • Natural language prompt input
  • Support for --start-uri or --url (mutually exclusive)
  • Optional --title, --download, --environment-id flags
  • Login via --credentials or --login-snippet-id (mutually exclusive)
  • Single platform support via --platform (defaults to windows11_chrome)
  • Supported platforms: windows10_chrome, windows11_chrome, windows11_chrome_fhd

Implementation Highlights

  • Added CreateTestWithAI() API method
  • Comprehensive validation (browser support, mutual exclusivity, required fields)
  • UTF-8 safe prompt truncation for default titles
  • Single browser enforcement (API limitation)

Version: 3.7.0

@marvin-rfbot
Copy link

marvin-rfbot bot commented Feb 3, 2026

This comment was marked as outdated.

This comment was marked as outdated.

@sebaherrera07 sebaherrera07 changed the title RF-39249 Add generate command for AI test generation [WIP] RF-39249 Add generate command for AI test generation Feb 3, 2026
@sebaherrera07 sebaherrera07 force-pushed the RF-39249-support-ai-test-generation branch 2 times, most recently from 7119044 to 7fa7b22 Compare February 3, 2026 18:26
@sebaherrera07 sebaherrera07 requested a review from Copilot February 3, 2026 18:26
@sebaherrera07 sebaherrera07 force-pushed the RF-39249-support-ai-test-generation branch from 7fa7b22 to 4be863d Compare February 3, 2026 18:29

This comment was marked as outdated.

@sebaherrera07 sebaherrera07 changed the title [WIP] RF-39249 Add generate command for AI test generation [WIP] RF-39249 Add AI Test Generation and Regeneration Commands Feb 3, 2026
@sebaherrera07 sebaherrera07 force-pushed the RF-39249-support-ai-test-generation branch from 4be863d to c179fac Compare February 3, 2026 21:46
@sebaherrera07 sebaherrera07 requested a review from Copilot February 3, 2026 21:48

This comment was marked as outdated.

This comment was marked as outdated.

@sebaherrera07 sebaherrera07 force-pushed the RF-39249-support-ai-test-generation branch 2 times, most recently from 22f31f0 to 74bf734 Compare February 4, 2026 17:38
@sebaherrera07 sebaherrera07 changed the title [WIP] RF-39249 Add AI Test Generation and Regeneration Commands [WIP] RF-39249 Add AI Test Generation Command Feb 4, 2026
@sebaherrera07 sebaherrera07 force-pushed the RF-39249-support-ai-test-generation branch from 74bf734 to b696760 Compare February 4, 2026 18:00
Add support for generating tests using AI through the CLI. The new
`generate` command (with `gen` and `ai` aliases) accepts a natural
language prompt and creates a test via the Rainforest API.

Features:
- Generate tests from natural language prompts
- Support for --start-uri or --url to specify the starting point
- Optional --title flag (defaults to prompt text)
- Optional --download flag to save generated test as RFML
- Optional --test-folder flag to specify download location
- Optional --environment-id flag for test environment
- Support for authentication via --credentials or --login-snippet-id
  (mutually exclusive)
- Platform selection with --platform (defaults to windows11_chrome)
- Validation for AI-supported browsers (windows10_chrome,
  windows11_chrome, windows11_chrome_fhd)
- Comprehensive validation and error handling

Example usage:
  rainforest generate "Log in with valid credentials" --start-uri /login
  rainforest generate "Add item to cart" --url https://example.com --download

Files changed:
- rainforest/tests.go: Add AITestRequest, AITestResponse structs,
  AISupportedBrowsers list, IsAISupportedBrowser helper, and
  CreateTestWithAI API method
- rainforest/tests_test.go: Add comprehensive unit tests for AI generation
- tests.go: Add generateAITest and parseAndValidateBrowser helper functions
- tests_test.go: Add tests for generateAITest with various scenarios
- rainforest-cli.go: Add generate command definition with all flags
- README.md: Add documentation and examples for the new command
Update version constant and add CHANGELOG entry for the new
`generate` command feature.
@sebaherrera07 sebaherrera07 force-pushed the RF-39249-support-ai-test-generation branch from b696760 to 26f2e5f Compare February 4, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant