UnifyApps Headless
Logo
Test loop

Test loop

Logo

4 mins READ

The test loop handles your tests from start to end. This page shows its 3 modes, what it can test, and what you get at the end.

Before you start

  • A folder set up with /ua:setup.

  • For discover: a PRD for the app or AI agent. A PRD is a product requirements document. Without one, discover stops. Write one with /ua:scope-loop first.

  • For a web app's build, and for --walk: the app is published, and Test Studio is on for your tenant.

  • Test users on the app, one per role. Tests never run as you.

  • For an AI agent: evaluation set up on your tenant.

  • In Codex, type $ua:test-loop. In Copilot CLI, ask in words.

What it does

Tests show that your app or AI agent still works after each change. The test loop writes the tests, turns them into tests that run, and runs them.

You stay in control of what gets tested. You approve each test case before it becomes a real test.

What it can test

It is about

What the tests are

A web app or code app

UI tests in Test Studio, the UnifyApps place for browser tests

An AI agent

An evaluation: test conversations, scores that check each answer, and a test run setup

Note: A mobile app and an automation have no test loop. The build loop and the repair loop check them instead. They check a mobile app on a simulator, and an automation with test runs.

The 3 modes

Put the mode as the first word after the command. The modes go in this order.

Mode

What it does

What you get

discover

Writes test cases from the PRD. You review them on one web page. Click Download decisions, then move the file into the folder it names.

Each case approved or turned down

build

Turns the approved cases into tests that run

Each approved case saved as a real test, or a reason why not

run

Runs the tests and writes a report

A report with each result and why each failure happened

If you leave out the mode, it reads your words. "Write cases" means discover. "Automate" means build. "Run" or "report" means run. If it is still not clear, it asks you.

Tip: For a web app, add --walk to discover. The loop also walks through the live app and adds cases for what it finds.

Stay for the start of build

At the start of build, a browser window opens for each test user. Type that user's password there, within 5 minutes. After that, the loop asks nothing until it is done. The sign-ins are saved on this computer, so the next run asks less.

What you can give it

  • The name, id or address of an app or AI agent.

  • A ticket. In run mode, a ticket names a fix. It runs the tests for that fix and checks that it works. This works for a web app.

  • A suite or plan name, in run mode, after the app.

  • A link to a code app pull request. It runs only the tests that the changed files reach. It runs them on the pull request's preview. Sign in to the GitHub CLI (gh) first, or give the branch and preview link. The app needs Test Studio tests already, and your tenant must allow the preview's address.

Examples

/ua:test-loop Test the New Order page

/ua:test-loop discover --walk <app>

/ua:test-loop build <app>

/ua:test-loop run <app> <suite or plan>

You can also say it in words: "write test cases for the Purchase Orders app".

How it works

Step 1: It finds the mode

It reads the first word, or works out the mode from your words.

Step 2: It finds the app or agent

It reads the app, agent or ticket you named. If it cannot tell which one, it asks you. It never guesses.

Step 3: It runs that mode to the end

It tells you in one line which kind of test it is running, and why. Then it does the whole mode.

Step 4: It names the next mode

After discover, it tells you to run build. After build, it tells you to run run. If a mode needs something that is missing, it names the mode that makes it.

What you get at the end

  • After discover: a list of approved test cases, and the counts.

  • After build: real tests, one for each approved case, or a reason for each one left out. One run makes up to 60 cases. Run build again for the rest.

  • After run on a web app: one report with each case's result, and why each failure happened. A copy goes to your Downloads folder.

  • After run on an AI agent: a scorecard with each case's scores and reasons, the cost and the speed. A run calls the agent once per test case, at real model cost.

Tip: To fix what a test run found, use the repair loop.

Next steps