testivai run
Wraps your test command, connects to Chrome via CDP, and captures visual snapshots.
Usageโ
testivai run "<your-test-command>" [options]
Examplesโ
# Cypress
testivai run "cypress run --browser chrome"
# pytest
testivai run "pytest tests/ -v"
# Jest + Selenium
testivai run "npx jest tests/"
# Maven / JUnit
testivai run "mvn test"
# Robot Framework
testivai run "robot tests/"
# RSpec
testivai run "bundle exec rspec"
How It Worksโ
- Starts your test command as a child process
- Waits for Chrome to open
--remote-debugging-port=9222 - Connects via CDP WebSocket
- Injects
window.testivaiWitnessglobally - Each
witness()call triggers a 5-layer capture - Uploads the batch to TestivAI when tests complete
Optionsโ
| Flag | Description |
|---|---|
--project <id> | Override the project ID from testivai.config.ts |
--branch <name> | Override the branch name (defaults to current git branch) |
--debug | Print verbose CDP connection logs |