π Quickstart
Install CLIβ
npm i -g testronaut
Initialize a projectβ
testronaut --init
creates: missions/, testronaut-config.json, and the configured report directory
run the welcome mission:
testronaut welcome.mission.js
π Directory Structure Your project should include a missions/ folder with mission files like:
missions/
βββ login.mission.js
βββ logout.mission.js
βββ dashboard.mission.ts
Each file exports an executeMission function and invokes runMissions. Both .js and .ts missions support standard import/export syntax without requiring "type": "module" in package.json.
βοΈ Writing a Mission Fileβ
Create a file in your missions/ directory, e.g. missions/login.mission.js:
import { runMissions } from 'testronaut';
export const loginMission = `
Visit ${process.env.URL}.
Fill the username field with ${process.env.USERNAME}.
Fill the password field with ${process.env.PASSWORD}.
Take a screenshot.
Submit the form.
Wait for the dashboard to appear.
Take another screenshot.
Report SUCCESS if the dashboard is loaded, otherwise report FAILURE.
`;
export async function executeMission() {
await runMissions({
mission: loginMission
}, "Login Mission");
}
βοΈ Environment Variablesβ
Testronaut reads your .env file for credentials and API access keys. Depending on your selected LLM provider, youβll include the appropriate key:
# Example: OpenAI
OPENAI_API_KEY=sk-...
# or Gemini
GEMINI_API_KEY=AIza...
# or Anthropic Claude
ANTHROPIC_API_KEY=sk-ant-...
# Mission variables
URL=https://example.com/login
USERNAME=example@example.com
PASSWORD=********
π Run Your Missionβ
testronaut login.mission.js
testronaut missions/login.mission.js # direct paths support tab completion
Inspect discovery and tags without starting a browser:
testronaut list
testronaut --dry-run
testronaut config
Youβll get a run ID and a report in:
<outputDir>/run_<runId>.json
Screenshots are stored under <outputDir>/screenshots/run_<runId>/. Reports include the CLI version plus each mission's display name and source filename.
β Next: Write your own missions, or upload a report and explore Mission Control.