> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quiesco.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Test UI

> Run tests from the browser with quiesco ui and watch them live: progress, failures and Quiesco's evidence.

`quiesco ui` opens a page in the browser with every test of the project. Click to run all tests, a file or
a single test, and watch the run live: what is running on which device, what passed and failed, the error,
and the evidence Quiesco saved at a failure (screenshot, element tree, idle state, logs).

## Starting

```sh pnpm theme={null}
pnpm add -D @quiesco/ui
pnpm exec quiesco ui --platform web
pnpm exec quiesco ui --platform ios --config vitest.e2e.config.mts
```

```sh npm theme={null}
npm i -D @quiesco/ui
npx quiesco ui --platform web
npx quiesco ui --platform ios --config vitest.e2e.config.mts
```

```sh bun theme={null}
bun add -d @quiesco/ui
bunx quiesco ui --platform web
bunx quiesco ui --platform ios --config vitest.e2e.config.mts
```

```sh yarn theme={null}
yarn add -D @quiesco/ui
yarn quiesco ui --platform web
yarn quiesco ui --platform ios --config vitest.e2e.config.mts
```

It prints the page's address and opens it (`--no-open` does not). `--platform`, `--runner`, `--workers` and
the runner's own arguments mean what they mean for [`quiesco test`](./cli#quiesco-test); the runner's
arguments are used for every run and for listing the tests. `--port N` chooses the port (default: a free
one). Ctrl-C stops it.

While it runs, the Metro dev server stays up, so a run started from the page does not wait for it. The
runner must send its progress, as for the [progress bar](https://docs.quiesco.dev/cli.md#quiesco-test): Vitest needs
`quiescoPlugin()`, Jest the preset's reporter and cucumber-js nothing ([test runners](https://docs.quiesco.dev/runners.md)).

## The page

The screenshots below are the [tutorial](https://docs.quiesco.dev/tutorial.md)'s todo app run on the web, with one test made to fail.

### Header and progress

![The test UI while a run is in progress: the progress ring at 6 of 8, the test tree with passed tests and one running](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/ui/running.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=119c6bb776583cfee449e91d5743ff27)

A run in progress: 6 of 8 tests done, two running

* **Header**: the project, the runner and the platform (`todo-tutorial · vitest · web`); the search box;
  whether the page is connected to `quiesco ui`; the language and the theme; **Stop** and **Run all**.
  While a run is going, Run all turns into *Running…*.
* **Progress**: done / total with a ring, the run's state and the time so far, and how many tests passed,
  failed and were skipped. With several workers there is one lane per device, with the test it is running.

### Test list

The left column lists the test files and their tests as the runner reports them without running them (the
same list as [`quiesco list`](./cli#quiesco-list)). Each test shows its last result and duration; each file
how many of its tests have run, in red once one of them failed. The list follows changes to the test files;
the ↻ button lists them again.

* **Filters**: All, Failed, Running, Skipped, Passed, each with its count.
* **Order**: file order, failed first, or slowest first.
* **Search** (in the header): by test name, file or `@tag`.
* **Run**: the ▶ next to a file or a test runs just that.

### Report

![The Report tab of a failed test: the expected and actual text, the evidence files and the stack](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/ui/report.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=21753a404c803abec2d3f03aae68c1e5)

Report: the error, the stack and the evidence saved at the failure

Selecting a test opens its details: the result, the file and line, the device, the duration, and
**Run again**. The **Report** tab has the error as the runner reported it — here what `expectText`
expected, what it found and the current route — the paths of the evidence files, and the stack. **View
evidence** opens the next tab.

### Evidence

![The Evidence tab: the failure screenshot with the asserted element framed in red, and the JSON and timeline files](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/ui/evidence.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=2291fd2fe414ad02d7475cc2070c7964)

Evidence: the failure screenshot and the files Quiesco saved

Everything Quiesco saved at the failure ([artifacts](https://docs.quiesco.dev/api-artifacts.md)): `failure.png` with the elements of
the failed call framed in red, then `elements.json`, `element-tree.json`, `idle-state.json` and the
timeline, each with the beginning of its content and an **Open** link. The device log is listed here too
when the [artifacts policy](https://docs.quiesco.dev/api-artifacts.md) keeps it.

### Console

![The Console tab: no output kept for this test, and the runner output of the last run](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/ui/console.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=7a63ca737b676a1b9e0a3e5614c49828)

Console: the test's own output and the runner's

**This test** is the test's own output: Vitest keeps console output per test, cucumber-js keeps
`this.log()`. **Runner output** is everything the runner printed in the last run, with its summary.

### Source

![The Source tab: the test file read-only, the test's first line marked in blue and the failing line in red](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/ui/source.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=949b069bdef55e2667ee16fb3cc1ef24)

Source: the test, with its first line and the failing line marked

The test file, read-only, scrolled to the test: its first line is marked in blue, the line that failed in
red.

### Keyboard, language and theme

![The test UI in Simplified Chinese with the dark theme](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/ui/dark-zh.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=275f538b2def26f335385eda60116155)

The same page in Chinese, with the dark theme

Keyboard: `/` search, ↑ ↓ ← → in the tree, `r` runs the focused file or test, Ctrl/⌘ + Enter runs all,
Ctrl/⌘ + . stops (the shortcuts are listed under the tree). The page is in English, 简体中文 or 日本語 (the
browser's language, or the one chosen in the header), in a light or a dark theme (the button next to the
language).

## Running tests

One run at a time: there is one device (or one per worker), so the run buttons wait until the current run
ends. A run starts the runner the way `quiesco test` does, with the chosen tests added:

| Runner | One file | Chosen tests |
| - | - | - |
| cucumber-js | `features/a.feature` | `features/a.feature:12:30` (Scenario or Examples row lines) |
| Vitest | `e2e/a.test.ts` | `e2e/a.test.ts:5` per test |
| Jest | `--runTestsByPath e2e/a.test.js` | the files and `-t '^(full name\|…)$'` |

Stop ends the runner and its workers. Tests outside the chosen ones keep their last result (Vitest and Jest
report them as skipped; the page ignores that).

> [!NOTE]
>
> cucumber-js adds paths given on the command line to the `paths` of its config instead of replacing them, so
> with `paths` in `cucumber.mjs` a run of one test runs those paths too. Leave `paths` out of the config (as
> `quiesco init` does) and pass paths on the command line.

## Security

The page is served on `127.0.0.1` only. Its address carries a random token (kept in a cookie after the first
visit); requests with another host or origin are refused. It serves files only from the artifacts directory
(evidence) and the listed test files (source), never other files of the project.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.