AI-powered Playwright test generator that analyzes web pages and produces executable test code.
Provide a URL, get back working Playwright tests. The system:
- Crawls the page with Playwright to extract forms, buttons, and inputs
- Sends page structure to GPT-4 to generate test scenarios
- Converts scenarios into executable Playwright TypeScript code
- Runs tests in Chromium and captures screenshots
- Returns results with generated code
- Frontend: React, TypeScript
- Backend: Node.js, Express, TypeScript
- Testing: Playwright
- AI: OpenAI GPT-4
# Clone and install
git clone https://github.com/yourusername/smarttest-studio.git
cd smarttest-studio
# Backend
cd backend
npm install
npx playwright install chromium
cp .env.example .env
# Add OPENAI_API_KEY to .env
# Frontend
cd ../frontend
npm install
# Run (two terminals)
cd backend && npm run dev
cd frontend && npm startVisit http://localhost:3000
smarttest-studio/
├── backend/
│ ├── src/
│ │ ├── routes/api.ts # Express API
│ │ ├── services/
│ │ │ ├── crawler.ts # Page analysis
│ │ │ ├── aiGenerator.ts # GPT-4 integration
│ │ │ ├── codeGenerator.ts # Code generation
│ │ │ └── testExecutor.ts # Test execution
│ │ └── types/
│ └── package.json
└── frontend/
├── src/
│ ├── components/ # React UI
│ └── api/client.ts
└── package.json
// Request
{ "url": "https://example.com/login" }
// Response
{
"pageAnalysis": { ... },
"testScenarios": [ ... ],
"playwrightCode": "import { test } from '@playwright/test'...",
"results": { ... },
"screenshots": [ ... ]
}Input: https://the-internet.herokuapp.com/login
Generated code:
import { test, expect } from '@playwright/test';
test('Valid login credentials', async ({ page }) => {
await page.goto('https://the-internet.herokuapp.com/login');
await page.fill('#username', 'tomsmith');
await page.fill('#password', 'SuperSecretPassword!');
await page.click('button[type="submit"]');
await expect(page.locator('.flash.success')).toBeVisible();
});MVP scope:
- Single-page analysis
- No auth/persistence
- Local execution only
- Basic error handling
MIT
Built for Stably AI application to demonstrate Playwright and LLM integration.