AskUIDocs
Writing Tests

Setup, Teardown & Rules

The three steering files of a suite, entry criteria, cleanup, and standing instructions. What each is and how to create it.

Every suite folder can carry three steering files. Their scope chains per folder level; each quick-create seeds a starter template, adjust it to your application, keep the shape.

Setup

The suite's entry criteria: open the application, log in, reset data. Runs once, before any case in its folder, a failing setup marks the suite's cases as skipped instead of executing them against a bad state.

Create it: right-click the folder → New setup.md.

setup.md
## Setup Steps

1. Open the application under test and wait until it is fully visible.
2. Log in using the `login_to_ui` procedure with the QA username and password secrets.
3. Verify the start screen has loaded before any test starts.

Teardown

The suite's cleanup: sign out, delete created records. Runs last, after every case in its folder, even after failures.

Create it: right-click the folder → New teardown.md.

teardown.md
## Teardown Steps

1. Close the application under test.
2. Clear any temporary files created during testing.

How a setup or teardown ends

A setup and a teardown record a result at the end, like a test does. The result decides what happens next:

ResultSetupTeardown
PASSED, or nothing recordedPassed. The tests run.Passed.
WARNINGPassed. Its reason appears in the summary report.Its reason appears in the summary report.
FAILED or BROKENFailed. The tests beneath it do not run and show as SKIPPED.Its reason appears in the summary report. The run goes on, also with the next folder.

Only a failed or broken setup counts towards the run's result: the run fails. A setup's warning and every teardown result appear in the summary but never count, so they never change the pass rate. The Management Report does not count setups and teardowns either, but it names every one that failed or broke (details).

The result is saved directly in the run folder, as <folder>_setup_result.json or <folder>_teardown_result.json. The agent picks the status by AskUI's status definitions.

Rules

Standing instructions that apply to every phase in the folder, not a test, context: interaction style, error handling, things never to do ("never change the language setting"). When a test counts as passed or failed is set by AskUI's status definitions, not by a rule.

Create it: right-click the folder → New rules.md.

rules.md
# Execution rules for this folder

## Interaction
- Use the desktop computer to execute these tests.

## Error handling
- On an infrastructure error (connection lost, session expired): record
  the result BROKEN and abort.
- On an application error: record the result FAILED and abort.

On this page