@vanya-lang/vanya
v0.3.4
Published
A constrained DSL for e2e tests
Readme
vanya
A constrained DSL for e2e tests, designed for auditability of AI-generated test code.
Vanya currently transpiles to Python (Playwright, Requests). JavaScript support is planned.
Example
Vanya test scenario (vanya-lang.org/v0.1)
Script title: "login_flow"
Within the Browser (plugin: "playwright-python", type: "browser", url: "http://localhost:3000")
go to "/login"
Within the Login Form (type: "element", id: "login_form")
type "[email protected]" into input with label: "Email"
type "secret123" into input with label: "Password"
click button (testid: "submit_btn", timeout: "5s")
Within the API (plugin: "python-requests", type: "api", base: "http://localhost:8080")
GET "/sessions/current"
expect status 200
expect json "$.email" == "[email protected]"
capture "$.session_id" as session_idInstall
# Recommended: use npx (no install needed, no permission issues)
npx @vanya-lang/vanya check my_test.vanya
npx @vanya-lang/vanya build my_test.vanya -o out/
# Or install locally in your project
npm install --save-dev @vanya-lang/vanya
# Or install globally (may require permission fixes on Linux)
npm install -g @vanya-lang/vanyaSee the installation docs for pip, curl, and other options.
Usage
vanya check tests/*.vanya # Static validation
vanya fmt tests/*.vanya # Format in place
vanya build tests/*.vanya -o out/ # Transpile to target languageDesign
See docs/DESIGN.md for the full language specification.
License
MIT
