TrailWright QA
AI-powered Playwright testing for non-technical users
Empower BA and QA staff to create professional browser automation tests without writing code. Choose your approach: let AI drive autonomously, guide it step-by-step through chat or record directly through interaction in the browser.
TrailWrightQA requires a valid API key from one of the supported LLM providers (e.g. OpenAI, Gemini, or Anthropic) to generate tests.
Features
- 🤖 AI Self-Driving Mode - Give AI a goal and watch it autonomously build complete tests
- 💬 AI Step-by-Step Mode - Interactive chat interface to guide test creation with granular control
- 🎥 Record Mode - Perform actions yourself while AI generates Playwright code automatically
- 📊 Data-Driven Testing - Run tests with multiple variable sets using spreadsheet UI or CSV import
- 🔑 Credentials Management - Store and reuse login credentials securely across tests
- 🔗 Run Builder - Configure multi-test runs with ordering, browser reuse, and step selection
- 👀 Real-Time Viewer - See each action as it happens with QA-friendly summaries
- 🎯 One-Click Execution - Run tests and view results instantly
- 🔍 Playwright Trace Viewer - Time-travel debugging with full trace support
- 💾 File-Based Storage - No database required, everything in
~/.trailwright/ - 🔒 Local-Only - All data stays on your machine, API keys never leave your system
- 🚀 Zero Config - Works out of the box with sensible defaults
- 🎨 Multiple AI Providers - Supports Anthropic Claude, OpenAI GPT, Google Gemini
Quick Start (Windows)
Step 1: Install Node.js (one-time)
Download and install from nodejs.org - choose the LTS version.
Step 2: Download TrailWright
- Go to github.com/marktl/TrailWrightQA
- Click the green Code button
- Click Download ZIP
- Extract the ZIP to a folder (e.g.,
C:\TrailWrightQA)
Step 3: Run
Double-click start.bat in the extracted folder.
First run will take a few minutes to install dependencies. Once you see "Started", open http://localhost:3000 in your browser.
Mac/Linux Instructions
- Install Node.js:
brew install node(Mac) orsudo apt install nodejs npm(Ubuntu) - Download and extract the ZIP from GitHub
- Open Terminal in the extracted folder
- Run:
chmod +x start.sh && ./start.sh
Developer Setup (with Git)
git clone https://github.com/marktl/TrailWrightQA.git cd TrailWrightQA npm install && npm run setup npm run dev
First-Time Setup
- Click "Settings" in the top right
- Choose your AI provider (Anthropic, OpenAI, or Gemini)
- Enter your API key
- Optionally set a default base URL for your tests
Usage
AI Self-Driving Mode (Recommended for Clear Goals)
Give AI a goal and watch it autonomously build your test:
- Click "Generate with AI (Self-Driving)" on the home page
- Fill in the form:
- Starting URL: Where to begin (e.g.,
https://example.com/login) - Goal: What to accomplish (e.g., "Search for 'teddy bear', add to cart, and complete purchase")
- Max Steps: Safety limit (default: 20)
- Starting URL: Where to begin (e.g.,
- Click "Start Generation"
- New tab opens showing:
- Browser automation happening live (headed mode)
- Each step with QA summary and Playwright code
- Real-time system logs
- Current status and progress
- When complete, click "Save Test" to add to your library
How it works:
- AI observes page using accessibility tree
- Autonomously decides next action (click, fill, select, etc.)
- Executes action in visible browser
- Records step with QA-friendly summary
- Repeats until goal achieved or max steps reached
- After 2 failed retries, shows screenshot and asks for help
AI Step-by-Step Mode (Recommended for Granular Control)
Guide AI through chat to build tests interactively:
- Click "Generate with AI (Step-by-Step)" on the home page
- Optionally create variables (e.g.,
{{product}},{{color}}) - Browser opens and chat interface appears
- Give instructions via text:
- "Go to example-shop.com"
- "Search for {{product}} in {{color}}"
- "Add first result to cart"
- Watch AI execute each instruction in real-time
- Each step generates Playwright code automatically
- Click "Save Test" when complete
With Variables:
- Create variable chips before or during test creation
- Drag variables into chat prompts
- Add sample values for test execution
- AI generates parameterized Playwright tests
- Later manage data in spreadsheet view or import CSV
Record Mode (Recommended for Demonstrations)
Perform actions in the browser and let AI generate the code:
- Click "Create Test" → Select "Record Mode"
- Enter test name and starting URL
- Click "Start Recording"
- Browser opens with recording toolbar at top
- Perform your actions normally:
- Click buttons and links
- Type into input fields (Tab or click away to capture)
- Select dropdown options
- Navigate between pages
- Click "Stop Recording" in toolbar
- Review captured steps in viewer
- Delete any incorrect steps if needed
- Click "Save Test"
Best Practices:
- Go slow: Allow 1-2 seconds between actions
- Tab out of inputs: Press Tab after typing to capture text
- Keep tests focused: 5-15 steps per test
Data-Driven Testing
Run the same test with multiple data sets:
- Create test using step-by-step mode with variables
- After saving, open test and go to "Data" tab
- See spreadsheet view with your variables as columns
- Add rows manually or click "Import CSV"
- Map CSV columns to your variables
- Run test - each row executes as separate test case
- View results with individual pass/fail and traces per row
CSV Format:
product,color,size
teddy bear,brown,small
teddy bear,brown,large
action figure,red,medium
Run Tests
- Find your test in "Recent Test Sets"
- Click "Run & Watch" to execute
- View live progress with step-by-step updates
- Click "Open Trace" for time-travel debugging
Manage Tests
- All tests stored as
.spec.tsfiles in~/.trailwright/tests/ - Edit tests directly or via UI "Edit" button
- Delete tests you no longer need
- Tests are standard Playwright - run them anywhere
Example Test Scenarios
Self-Driving Examples
Simple Google Search:
Mode: Self-Driving
URL: https://www.google.com
Goal: Search for "Playwright testing" and verify results appear
Max Steps: 5
E-Commerce Purchase:
Mode: Self-Driving
URL: https://example-shop.com
Goal: Search for 'teddy bear', add to cart, and complete purchase
Max Steps: 20
Step-by-Step Examples
Guided Shopping:
Mode: Step-by-Step
Instructions:
1. "Go to example-shop.com"
2. "Click search bar, type 'stuffed teddy bear' and search"
3. "Add first result to cart"
4. "Proceed to checkout"
With Variables:
Mode: Step-by-Step
Variables: {{product}}, {{color}}, {{size}}
Sample: "teddy bear", "brown", "small"
Instructions:
1. "Search for {{product}} in {{color}}"
2. "Filter by size {{size}}"
3. "Add first result to cart"
Record Mode Examples
Form Submission:
Mode: Record
Name: Contact Form Test
URL: https://example.com/contact
Actions performed:
1. Click name field, type "John Doe", Tab
2. Click email field, type "john@example.com", Tab
3. Click Submit button
→ 3 steps captured with screenshots
Data Location
All data is stored in ~/.trailwright/:
config.json- Settings, API keys, provider selectioncredentials.json- Saved login credentialstests/*.spec.ts- Your test files with metadatatest-data/*.csv- Variable data for parameterized testsruns/- Test results, traces, screenshots, videosplaywright.config.ts- Auto-generated Playwright configuration
Custom Data Location
You can customize where TrailWright stores all its data using environment variables:
TRAILWRIGHT_DATA_DIR - Controls the base data directory (default: ~/.trailwright)
This moves everything: config, credentials, API keys, test variables, run results, and tests.
:: Windows - store all data on D: drive set TRAILWRIGHT_DATA_DIR=D:\TrailWrightData start.bat :: Mac/Linux TRAILWRIGHT_DATA_DIR=/path/to/data ./start.sh
TRAILWRIGHT_TESTS_DIR - Controls only the test file location (optional)
Use this if you want tests in a different location than other data (e.g., in a git repo).
:: Windows - tests in a separate location set TRAILWRIGHT_DATA_DIR=D:\TrailWrightData set TRAILWRIGHT_TESTS_DIR=D:\MyProject\tests start.bat :: Mac/Linux TRAILWRIGHT_DATA_DIR=/data TRAILWRIGHT_TESTS_DIR=/project/tests ./start.sh
Environment variables are applied on first run, or when config doesn't already have a custom directory set.
Settings UI (anytime)
You can also change the test directory via Settings:
- Go to Settings
- Find "Test Storage Location" section
- Enter your desired path
- Click "Change Location"
- Choose whether to move existing tests
When changing directories with existing tests, you'll be prompted to either move them to the new location or keep them in place.
Tech Stack
- Backend: Node.js, Express, TypeScript, Playwright
- Frontend: Vite, React, Tailwind CSS, React Router
- AI: Anthropic SDK, OpenAI SDK, Google Generative AI
Development
# Run tests cd server && npm test # Build for production npm run build # Start production server cd server && npm start cd client && npm run preview
Architecture
TrailWright is a single-user, local-first application designed for non-technical users:
- Server: Express + TypeScript backend
- Three test creation modes: Self-driving, Step-by-step, and Record
- Iterative AI agent loop with accessibility tree capture
- CDP-based action recording for Record mode
- Variable resolution and parameterized test generation
- Credentials management for reusable login data
- Multi-test Run Builder with browser reuse
- Playwright test execution in headed mode
- Server-Sent Events (SSE) for real-time updates
- Multi-provider AI support (Anthropic, OpenAI, Gemini)
- Client: Vite + React + Tailwind CSS frontend
- Test creation wizard with mode selection
- Interactive chat interface for step-by-step mode
- Record mode viewer with step management
- Run Builder drawer for multi-test configuration
- Variable management with spreadsheet UI
- Credentials management UI
- CSV import/export with column mapping
- Live generation viewer with real-time streaming
- Settings UI for API configuration
- Storage: File-based (no database needed)
- Tests stored as standard Playwright
.spec.tsfiles - Variables stored as CSV files (one per test)
- Tests stored as standard Playwright
- Security: All data local, API keys never sent to external services
Key Technologies
- Playwright - Browser automation with accessibility tree API
- TypeScript - Type-safe development
- Server-Sent Events - Real-time streaming without WebSockets
- React Router - Client-side routing
- Tailwind CSS - Utility-first styling
License
MIT