Skip to content

Syntax Overview

File Structure

Every vanya file starts with a header declaring the language version and script title:

Vanya test scenario (vanya-lang.org/v0.1)
Script title: "login_test"

The Vanya test scenario (domain/version) line declares the language version. The Script title: line provides a name for the test script (used for generated file names).

Indentation

Vanya uses significant indentation (like Python). Blocks are defined by their indentation level:

Within the Browser (plugin: playwright-python, type: browser, url: 'http://localhost:3000')
go to "/login"
Within the Login Form (type: element, id: 'login_form')
Define email-input (label: 'Email')
type "user@example.com" into email-input
click submit-button

Use consistent indentation (2 or 4 spaces). Tabs are not allowed.

Comments

Single-line comments start with #:

# This is a comment
go to "/login" # inline comment

Strings

Strings can use single or double quotes:

go to "https://example.com"
click button (id: 'submit')

Keywords

Vanya has the following reserved keywords (all sentence case):

  • Vanya - file header declaration
  • Script - script title declaration
  • Within - context block (always followed by the)
  • Define - alias definition
  • Export - variable export
  • Capture - capture a value into a variable

Next steps