The Anvil Book
Learn to use Anvil from nothing: install it, write test steps, put them in sequences, run them, and read what Anvil says back.
Alpha. This edition is written and checked against Anvil 0.5.0 on Linux x86-64; installing on Windows is covered and checked too. Anvil is young, and some of what you will do here — cloning the repository to get the step SDK, above all — will get shorter. Where 0.5.0 has a rough edge or a known defect, the book says so where you meet it, rather than pretending it is not there.
Contents
- Introduction — what Anvil is, the words it uses, and what you need.
- Installing — the engine, the step SDK, your working folder.
- Your first step — a C# method the engine can call.
- Your first sequence — the file that says what to run, and how to run it.
- Measuring and judging — limits, pass, fail and error.
- Setup, main, cleanup and retries
- Inputs, variables and flow
- Instruments that stay open — references to objects that live in the executor.
- Subsequences
- Reports and running unattended
- The Sequence Editor — not written yet. In 0.5.0 the packaged editor opens, but it cannot run a sequence (#80).
- Steps in Python and Rust
- When something goes wrong
Read chapters 1 to 4 in order. After that each chapter stands mostly on its own, although each one adds a file or two to the same C# project.
Conventions
Everything happens in one folder, ~/anvil-book. Commands start with $ and
are run from that folder, unless the text says otherwise. The lines after a
command are what it printed — pasted from a real run, not retyped.
Anvil’s own diagnostic messages are still partly in Spanish in 0.5.0 (#59). The book shows them as they are printed and explains what they say.
How this book stays true
Every command in these chapters has been run against the release named above,
and none of the output was written by hand. The files you are asked to write
live in listings/, the terminal sessions in
listings/sessions/, and check.sh runs
every session again and checks that each file still appears word for word in
a chapter:
$ docs/book/check.sh path/to/anvil-v0.5.0-x86_64-linux-musl
What could not be run is marked not verified, with those words.