Your first test
Save this as hello.tscr:
flow verifyName(name: String) {
step "Validate the name" {
expect len(name) > 0
}
}
test "A valid user" tags ["smoke"] {
verifyName("Angel")
}
testgives the runner a discoverable case.flowgives that case a reusable behavior.stepadds a readable section to the execution events.expectrequires a Boolean expression and fails when it is false.tagsattach metadata used for selection.
check validates syntax, names, available type information and effect restrictions. It does not open a browser or send requests. It reads imported modules and local data files and can evaluate pure module initializers.
See a failure
Change the flow call to verifyName(""). The assertion fails, the case is marked failed, the process exits with code 1 and the reports retain the failing source location.
Compose behavior
Flows can call other flows. Functions declared with fn compute values without accessing the system under test. Put browser/API behavior in flows and data transformations in functions. Direct actions in tests are permitted; the optional flows-only linter encourages extracting them.
Continue with concepts, the language or complete examples.