AI AGENT · NEW

Automate a manual test case

Give your agent a test case ID or the steps. It runs them in the live app, then writes a linked BELLATRIX test. You review it and run it.

Before you start

Set up your agent with bellatrix init. Save each manual test case as Markdown in test-cases/<suite>/TC-<id>.md (the folder is set in .bellatrix/config.json), with an id, steps and an expected result:

---
id: TC-1006
priority: medium
component: unit-converter
---
# Convert 1 meter to feet using Length converter

## Steps
1. Open Unit Converter from the navigation menu
2. Select 'Length' category
3. Select 'Meters' as the source unit
4. Select 'Feet' as the target unit
5. Enter '1' in the meters input field

## Expected Result
The feet field displays approximately 3.28084 feet
Example test case from the BELLATRIX demo project (shortened).

What to say to your agent

  • Automate TC-1006.
  • Write a BELLATRIX test for TC-1006 Convert 1 meter to feet in the Windows Calculator.
  • Automate all high-priority tests in the unit converter suite, one at a time.
  • Automate this: open Calculator, switch to Length, convert 1 meter to feet, check 3.28084.

What you will see

  1. The agent reads the test case and starts the app.
  2. It runs every step in the live app and notes the real texts and states.
  3. Its locator specialist finds a stable locator for each control.
  4. It reuses your page objects and adds only what is missing.
  5. It writes the test with [ManualTestCase("TC-1006")] and builds the project.
  6. It adds automated_by to the test case file, then hands over to you.

Where the files end up

Page objects go to Pages/<Window>/, split into map, actions and assertions. The test goes to Tests/<Area>/:

Pages/UnitConverterWindow/UnitConverterWindow.Map.cs         locators
Pages/UnitConverterWindow/UnitConverterWindow.Actions.cs     steps
Pages/UnitConverterWindow/UnitConverterWindow.Assertions.cs  checks
Tests/UnitConverter/UnitConverterConversionTests.cs         the test
[Test]
[ManualTestCase("TC-1006")]
public void LengthConverter_OneMetreToFeet_DisplaysThreePointTwoEight()
{
    var converter = App.Create<UnitConverterWindow>();

    converter.NavigateTo(ConverterType.Length);
    converter.SelectInputUnit(LengthUnit.Meters);
    converter.SelectOutputUnit(LengthUnit.Feet);
    converter.EnterValue("1");

    converter.AssertOutputValueContains("3.28084 Feet");
}
Example code from the BELLATRIX demo project: a test for TC-1006.

Automate a whole suite

Ask for a suite, and the agent works through it one test case at a time. Each case gets its own live run, code and build. Cases that already have automated_by are skipped. High-priority cases go first.

Listing a suite uses the SPECTRA CLI. Without it, name the test cases in your prompt.

When there is no test case file

Write the steps and the expected result into the prompt, as in the last example above. The agent follows the same flow: it runs the steps live, then writes and builds the test. Without a test case file, there is nothing to link the test back to.

Review and run the test

The agent builds the test but does not run it. Review the changes, then run the test yourself, for example with dotnet test. If it fails, tell the agent what failed; it fixes the cause and builds again.

Under the hood
  • The steps run through bellatrix <domain> commands in a named session: start, snapshot, act, close.
  • Snapshots are saved to .bellatrix/snapshots/. The locator specialist reads them in its own context.
  • After automated_by changes, the agent refreshes the SPECTRA index when SPECTRA is installed.
  • More: How the agent works.