Your First Test
Create a test file
Create a file called login.vanya:
Vanya test scenario (vanya-lang.org/v0.1)
Script title: "User can log in"
Within the Browser (plugin: playwright-python, type: browser, url: 'https://example.com') go to "/login"
Within the Login Form (type: element, id: 'login_form') Define email-input (label: 'Email') Define password-input (label: 'Password') Define submit-button (testid: 'sign_in')
type "user@example.com" into email-input type "password123" into password-input click submit-button
see a div (text: 'Welcome back')Check the syntax
Run the checker to validate your test:
vanya check login.vanyaIf everything is correct, you’ll see:
login.vanya: OKBuild the test
Transpile to Python:
vanya build login.vanya -o out/This creates out/login.py (and out/login.py.vanyamap for source mapping) ready to run with pytest.
Run the generated test
cd outpip install pytest playwrightplaywright installpytest login.pyNext steps
- Learn more about vanya syntax
- Explore available plugins
- Read the CLI reference