A comprehensive web-based testing tool for UI/UX validation with admin panel verification. Built with Next.js, Playwright, PostgreSQL, and TypeScript.
- Test Builder UI: Create and manage test cases through a web interface
- Cloud Agentic Browser 🤖: AI-driven test exploration using OpenAI + Playwright on RunPod (docs)
- Playwright Automation: Execute tests using headless browser automation
- UX Metrics: Collect navigation timing, LCP, and accessibility metrics
- Admin Verification: Verify test results via API or UI in admin panels
- Visual Regression: Compare screenshots with baselines (optional)
- Test Reports: Comprehensive reports with screenshots, logs, and metrics
- Multi-User Support: User authentication and test isolation
- Frontend: Next.js 14 (App Router), React, TypeScript, TailwindCSS
- Backend: Next.js API Routes
- Database: PostgreSQL with Prisma ORM
- Browser Automation: Playwright
- Authentication: NextAuth.js
- Validation: Zod
- Node.js 18+ and npm
- PostgreSQL 12+
- Playwright browsers (installed via
npm run test:install)
npm installCopy .env.example to .env and fill in the values:
cp .env.example .envRequired environment variables:
DATABASE_URL="postgresql://user:password@localhost:5432/testing_tool"
NEXTAUTH_SECRET="your-secret-key-here-generate-with-openssl-rand-base64-32"
NEXTAUTH_URL="http://localhost:3000"
PLAYWRIGHT_BROWSERS_PATH="./.playwright"
STORAGE_PATH="./storage"Generate a secure NEXTAUTH_SECRET:
openssl rand -base64 32docker-compose up -dThis will start a PostgreSQL container on port 5432.
Create a database:
CREATE DATABASE testing_tool;npm run db:generate
npm run db:pushOr use migrations:
npm run db:migratenpm run db:seedThis creates a sample user (test@example.com / password123) and a sample test.
npm run test:installnpm run devThe application will be available at http://localhost:3000.
- Register/Login at
/registeror/login - Navigate to Dashboard
- Click "New Test"
- Fill in test details:
- Test name
- Target URL
- Admin panel URL (optional)
- Device profile (desktop/mobile/tablet)
- Admin verification config (optional)
- Add test steps using the step builder
- Save the test
- Go to the test edit page
- Click "Run Test" or navigate to
/tests/[id]/run - Click "Start Test Run"
- Monitor the execution in real-time
- View results, screenshots, and logs
- Navigate to
/test-runs/[id]/reportfor a detailed report - Reports include:
- Test summary
- UX metrics
- Step execution timeline
- Screenshots
- Admin verification results
- Execution logs
Call the API verification endpoint:
POST /api/test-runs/[runId]/verify-admin-api
{
"baseUrl": "https://api.example.com",
"authMethod": "bearer",
"credentials": {
"token": "your-api-token"
},
"endpoint": "/api/users/123",
"method": "GET",
"expectedData": {
"email": "user@example.com",
"status": "active"
}
}Call the UI verification endpoint:
POST /api/test-runs/[runId]/verify-admin-ui
{
"adminPanelUrl": "https://admin.example.com",
"loginSelector": {
"emailSelector": "input[name='email']",
"passwordSelector": "input[name='password']",
"submitSelector": "button[type='submit']"
},
"credentials": {
"email": "admin@example.com",
"password": "admin-password"
},
"navigationPath": "/users/123",
"extractionSelectors": {
"email": ".user-email",
"status": ".user-status"
},
"expectedData": {
"email": "user@example.com",
"status": "active"
}
}npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run db:generate- Generate Prisma clientnpm run db:push- Push schema to databasenpm run db:migrate- Run database migrationsnpm run db:seed- Seed database with sample datanpm run test:install- Install Playwright browsersnpm run test:ui- Run Playwright testsnpm run run-test- Run a test via CLI script
Use the CI script to run tests headlessly:
# Run by test ID (creates a new test run)
tsx scripts/ci-run-test.ts <testId>
# Run by test run ID
tsx scripts/ci-run-test.ts <testRunId> --run-idExample GitHub Actions workflow:
name: Run Tests
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- run: npm run db:generate
- run: npm run test:install
- run: tsx scripts/ci-run-test.ts ${{ secrets.TEST_ID }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── api/ # API routes
│ │ ├── dashboard/ # Dashboard page
│ │ ├── tests/ # Test management pages
│ │ └── test-runs/ # Test run pages
│ ├── components/ # React components
│ ├── lib/ # Shared utilities
│ ├── server/ # Server-side code
│ │ ├── adminVerification/ # Admin verification services
│ │ └── services/ # Business logic services
│ └── tests/ # Test engine
│ ├── engine/ # Playwright test execution
│ └── models/ # Test model types
├── prisma/ # Prisma schema and migrations
├── scripts/ # Utility scripts
└── storage/ # File storage (screenshots, etc.)
- User: User accounts
- Test: Test definitions
- TestStep: Individual test steps
- TestRun: Test execution instances
- TestLog: Execution logs
- AdminCheck: Admin verification results
- Attachment: Screenshots, videos, DOM snapshots
POST /api/auth/register- Register new userPOST /api/auth/login- Login (via NextAuth)
GET /api/tests- List user's testsPOST /api/tests- Create new testGET /api/tests/[id]- Get test detailsPUT /api/tests/[id]- Update testPOST /api/tests/[id]/steps- Update test stepsPOST /api/tests/[id]/run- Start test runPOST /api/tests/generate- Generate test steps (AI)
GET /api/test-runs/[runId]- Get test run detailsGET /api/test-runs/[runId]/logs- Get test logsGET /api/test-runs/[runId]/report- Get test reportPOST /api/test-runs/[runId]/verify-admin-api- API verificationPOST /api/test-runs/[runId]/verify-admin-ui- UI verification
- Admin Credentials: Currently stored with basic encryption. TODO: Integrate with KMS/vault for production.
- Authentication: Uses NextAuth.js with JWT. Consider additional security measures for production.
- API Keys: Store sensitive credentials in environment variables, never in code.
- Database: Use strong passwords and restrict access in production.
- File Storage: Local filesystem for dev. TODO: Use S3/Vercel Blob for production.
- Verify PostgreSQL is running
- Check
DATABASE_URLin.env - Ensure database exists:
CREATE DATABASE testing_tool;
- Run
npm run test:installto install browsers - Check
PLAYWRIGHT_BROWSERS_PATHin.env
- Check logs in the test run view
- Verify target URL is accessible
- Check selectors are correct
- Review browser console for errors
The application includes an advanced AI-driven test exploration feature that uses OpenAI and Playwright to automatically explore web applications and generate test steps.
- Railway: Hosts the Next.js app and manages agent sessions
- RunPod: Runs containerized agent workers with Playwright + OpenAI
- Worker polls Railway for pending sessions, explores apps, posts traces back
-
On Railway: Set
RAILWAY_INTERNAL_API_TOKENenvironment variableopenssl rand -hex 32
-
Deploy RunPod Worker:
cd src/agentWorker docker build -t agent-worker . docker push your-username/agent-worker:latest
-
Configure RunPod with environment variables:
RAILWAY_API_BASE_URLRAILWAY_INTERNAL_API_TOKENOPENAI_API_KEYOPENAI_MODEL(optional, defaults to gpt-4o-mini)
-
Use in UI:
- Go to test edit page
- Find "Cloud Agentic Recorder" section
- Enter scenario description
- Click "Start Cloud Agent Exploration"
- Wait for completion
- Click "Compile to Steps"
Full documentation: docs/AGENTIC_BROWSER_RUNPOD.md
Includes:
- Complete lifecycle explanation
- API reference
- Deployment guides
- Troubleshooting
- Example scenarios
- Add step type to
TestStepTypeinsrc/tests/models/TestStep.ts - Add handler in
src/tests/engine/stepHandlers.ts - Update validation schema in
src/lib/validations.ts - Update step builder UI in
src/components/StepBuilder.tsx
- Add metric collection in
src/tests/engine/metricsCollector.ts - Update
UXMetricsinterface - Update report components to display new metrics
- Visual regression with pixel-perfect comparison
- AI test generation with actual LLM integration
- Video recording for test runs
- Real device testing integration
- S3/Vercel Blob storage integration
- KMS/vault integration for credentials
- Advanced scheduling and queuing
- Team collaboration features
- Export reports as PDF
- Webhook notifications
MIT
Contributions welcome! Please open an issue or submit a pull request.