testpilotai
v0.1.2
Published
TestPilot AI — Generate end-to-end Playwright tests from user stories using AI
Downloads
328
Maintainers
Readme
testpilotai
Generate end-to-end Playwright tests from user stories using AI agents.
Prerequisites
- Node.js 18+
- TypeScript project with Playwright set up (
@playwright/testmust be installed) - Playwright browsers installed (
npx playwright install) - AI Gateway API key and base URL
Note: TestPilot currently supports TypeScript (Playwright) repositories only.
Install
npm install testpilotaiQuick Start
# 1. Initialize config in your project
npx testpilotai init- Create a
.envfile in your project root with your AI gateway credentials:
AI_GATEWAY_KEY=your-api-key
AI_GATEWAY_BASE_URL=https://your-gateway-url- Start TestPilot (opens UI in browser):
npx testpilotai runHow It Works
- Write a user story with acceptance criteria in the UI
- Select an AI model (GPT-4o, Claude, Gemini)
- The AI agent navigates your app via Playwright, discovers selectors, and generates TypeScript tests
- Tests are saved as
.spec.tsfiles and can be run withnpx playwright test
Commands
npx testpilotai init Create test-pilot.json config
npx testpilotai run Start UI + API server
npx testpilotai run --no-open Start without opening browserConfiguration
Running npx testpilotai init creates a test-pilot.json file. Projects, user stories, and settings are managed through the UI.
| Environment Variable | Required | Description |
| --------------------- | -------- | -------------------------- |
| AI_GATEWAY_KEY | Yes | API key for the AI gateway |
| AI_GATEWAY_BASE_URL | Yes | Base URL of the AI gateway |
These variables can be set in a .env file in your project root.
License
UNLICENSED
