Skip to main content

Choose a testing strategy

Keep assertions at the smallest level that exercises the behavior you need.

LevelTypical assertionSetup
Model or serviceA command changes application statePlain xUnit
Headless controlInput changes text, selection, layout, or bindingsProTest xUnit adapter
Rendered outputA border or custom control produces expected pixelsProTest plus Skia
Native applicationAn operating-system window exposes accessibility and native menusReal Appium tooling

Headless tests create Avalonia controls and the dispatcher in memory. A Window participates in layout and input processing without appearing on the desktop. This makes the same suite usable on local machines and CI hosts.

Use the Appium-style helpers to express in-process tests with familiar locators. These helpers still belong to the headless layer; real Appium tests exercise a launched application through native automation.

A practical progression is to test model state first, add headless tests for the controls that connect to it, and add image baselines or native tests for behavior that the earlier layers cannot observe.

Topic reference: Avalonia testing overview.