> ## 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.

# Tutorial: test a todo app

> Take a small todo app with three screens and write its end-to-end tests, step by step: test ids, flows across screens, backdoors, resets, and failures.

This tutorial starts from a working app and ends with eight tests that run unchanged on the web, iOS and
Android. Along the way you use everything a typical test needs: finding elements by test id, moving
between screens, filling in a form, setting up data through a backdoor, and reading a failure.

The tests are written three times, once for each [test runner](https://docs.quiesco.dev/runners.md). Set up the project on this page,
then pick one: the steps are the same, only the test code differs.

It takes about 30 minutes. You need Node.js 24+; for iOS and Android, the tools listed in the
[quick start](https://docs.quiesco.dev/quickstart.md).

## The app

The app is an Expo Router app with three screens. The repository has it three times, once per test runner:
[`todo-tutorial-vitest`](https://github.com/h2nology/quiesco/tree/main/examples/todo-tutorial-vitest), [`todo-tutorial-jest`](https://github.com/h2nology/quiesco/tree/main/examples/todo-tutorial-jest) and [`todo-tutorial-cucumber`](https://github.com/h2nology/quiesco/tree/main/examples/todo-tutorial-cucumber); only the tests differ.

![The todo list with two todos, one checked off, and a New todo button](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/tutorial/list.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=dd7f1ba50e656cb2bdecc2b0e255fc07)

The list (/)

![The new-todo form with a title and a notes field and a Save button](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/tutorial/new-todo.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=bd63d510aeeaa2bc82d0ce4e05e0683d)

New todo (/new)

![The details of a todo with Mark as done and Delete todo buttons](https://mintcdn.com/shift-14cc7601/yVeoZoE7ayMC30L-/images/tutorial/details.png?fit=max\&auto=format\&n=yVeoZoE7ayMC30L-\&q=85\&s=47abf7bc52081a224b11b9fb960d9469)

Details (/todo/\[id])

* **The list** shows every todo with a checkbox, and how many are done. **New todo** opens the form;
  tapping a todo opens its details.
* **New todo** asks for a title and optional notes. Saving takes a moment (it stands in for a request to a
  backend), then the app goes back to the list.
* **Details** shows one todo and has two buttons: mark it done (or open again) and delete it.

The todos live in memory (`src/store.ts`): every launch starts with an empty list.

## Get the project

Copy the example for your runner out of the repository and install it:

```sh Vitest theme={null}
npx degit h2nology/quiesco/examples/todo-tutorial-vitest quiesco-todo
cd quiesco-todo
npm install
```

```sh Jest theme={null}
npx degit h2nology/quiesco/examples/todo-tutorial-jest quiesco-todo
cd quiesco-todo
npm install
```

```sh Cucumber theme={null}
npx degit h2nology/quiesco/examples/todo-tutorial-cucumber quiesco-todo
cd quiesco-todo
npm install
```

Try the app with `npm run web` (or `npm start` for a dev client) if you like. The project is already set
up for Quiesco — it is what `npx quiesco init --runner <runner>` plus the [quick start](https://docs.quiesco.dev/quickstart.md)
steps produce:

| File | What it does |
| - | - |
| `index.ts` | Imports `@quiesco/agent` before `expo-router/entry`, so the agent sees the app from the first render |
| `metro.config.js` | `withQuiesco()`: the real agent in e2e builds (`EXPO_PUBLIC_QUIESCO=1`), a no-op stub otherwise |
| `app.json` | Lists `@quiesco/expo-plugin`, and sets the bundle id / package that `quiesco.config.mts` names |
| `src/app/_layout.tsx` | Wraps the app in `<QuiescoRoot>`, and loads `src/e2e.ts` in e2e builds only |
| `quiesco.config.mts` | Where the app is on each platform: the web export, the simulator build, the APK |
| `vitest.config.mts`, `jest.config.cjs` or `cucumber.mjs` | The runner's configuration: which test files it runs with Quiesco |
| `package.json` | The `e2e:*` scripts: `e2e:web`, `e2e:build:ios`, `e2e:ios`, `e2e:build:android`, `e2e:android` |

## Pick a runner

> [card] [Vitest (recommended)](https://docs.quiesco.dev/tutorial-vitest.md)
>
> Tests in TypeScript, with the app as the `app` fixture.

> [card] [Jest](https://docs.quiesco.dev/tutorial-jest.md)
>
> Tests in JavaScript, with the app in the global `quiesco.app`.

> [card] [Cucumber](https://docs.quiesco.dev/tutorial-cucumber.md)
>
> Scenarios in Gherkin, step definitions in TypeScript.


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