Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

  1. Introduction — what Anvil is, the words it uses, and what you need.
  2. Installing — the engine, the step SDK, your working folder.
  3. Your first step — a C# method the engine can call.
  4. Your first sequence — the file that says what to run, and how to run it.
  5. Measuring and judging — limits, pass, fail and error.
  6. Setup, main, cleanup and retries
  7. Inputs, variables and flow
  8. Instruments that stay open — references to objects that live in the executor.
  9. Subsequences
  10. Reports and running unattended
  11. The Sequence Editor — not written yet. In 0.5.0 the packaged editor opens, but it cannot run a sequence (#80).
  12. Steps in Python and Rust
  13. 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.