retest

Star6
View all files

Activity

Contributors

README

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/assets/retest-dark.svg"> <img alt="retest" src="docs/assets/retest-light.svg" width="600"> </picture> <br> by <a href="https://rehearsal.dev"><b>Rehearsal</b></a> </p> <p align="center"> <b>One test across web, mobile and desktop.</b><br> <b>Built for software engineers and coding agents.</b> </p> <p align="center"> <img alt="Status: early" src="https://img.shields.io/badge/status-early-f4b63f"> <img alt="Runtime dependencies: 0" src="https://img.shields.io/badge/runtime%20dependencies-0-5b3fe6"> <img alt="Node 24.12 or later" src="https://img.shields.io/badge/node-%E2%89%A5%2024.12-17915a"> <img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-0e1116"> </p>

Retest is a test runner and automation engine written from scratch, with its own drivers for Chromium, Firefox, WebKit, iOS simulator apps, macOS apps and Electron. One test can move between them, every action follows fixed rules, and AI only judges evidence when a test asks it to.

There is no Playwright, Puppeteer or Selenium underneath. Retest is early, and this page says plainly what runs today.

Quick start

You need Node.js 24.12 or later, on macOS or Linux.

TypeScript is only for type checks. Retest runs .ts test files without it.

retest init writes retest.config.ts, an example test and a tsconfig.json for your tests. It asks for your app's address and browser, or takes them as flags: npx retest init --app web=http://localhost:3000 --browser chrome. It never overwrites a file.

Write your first test in tests/task.retest.ts:

Run every .retest.ts file under the folder:

If a browser, a server or a secret is not ready, doctor says what is wrong and how to fix it:

Browsers

chrome() runs the Google Chrome installed on your machine. chromium() runs the Chromium build you point it to.

Retest downloads nothing unless you ask. retest install fetches a pinned build and checks its SHA-256 before it unpacks anything:

On macOS on Apple silicon, Retest pins Chrome for Testing, Firefox 133, Playwright's WebKit build 2359 and Electron 44.5.1. On Linux x64 it pins Chrome for Testing only. A Firefox target finds the installed build by itself. Give a Chromium, WebKit or Electron target the path that retest install prints.

What runs today

BrowsersChrome and Chromium. Firefox 133 and WebKit build 2359 on macOS on Apple silicon
iOS simulator appsFind, tap, fill and check elements through WebDriverAgent, built on your Mac from a pinned commit
macOS appsFind, click, fill and check elements through the macOS runner of appium-mac2-driver
Electron appsThe app's first window, driven like a Chrome page. Checked with Electron 44.5.1 on macOS
One test across platformsAn iOS simulator app, a macOS app and web apps in the same test
AI checkstest.evaluate asks a judge you choose whether a screenshot, text or recorded frames meet a requirement
Layout checksOverlapping elements, cut-off text, an element past the viewport's right edge and sideways scroll, each measured in pixels. Checked on Chrome on macOS
Screenshot baselinesA page or an element compared to a saved image, pixel by pixel, with the difference in the report. Checked on Chrome on macOS
Test inboxesA test reads a one-time code and a sign-in link from a mailbox your config reads, types and opens them, and never holds either. Checked on Chrome. The guide says how
FilesUpload by path or content, intercept the file picker, save downloads as artifacts. Checked on Chrome on macOS
Dialogs and popupsAccept or dismiss alert, confirm, prompt and beforeunload; drive a page the app opens. Checked on Chrome on macOS
Mocked responses and dragAnswer a request with your own response or refuse it; drag an element onto another. Checked on Chrome on macOS
Playwright test filesretest run --playwright runs .spec.ts files unchanged, for the methods the guide lists
LinuxChrome and Chromium only, checked inside Docker

Not yet: Android apps, Windows, Safari, and real phones or tablets.

One test across platforms

This test creates a task on an iPhone simulator, marks it done in Chrome, and sees it done in a macOS app. It is shortened from reference-flow.retest.ts, which runs against the fixture apps in that folder.

The password reaches each app through secret(), never through the test's source. The test has no sleeps. Each check keeps looking until the change from the other app arrives.

See exactly what went wrong

A failure is one card: the check, the element, what was expected, what the page showed, how long Retest looked, the line in your test, a screenshot, and the commands to rerun and inspect it. This is examples/task.retest.ts, the test above, run against an app that drops the last letter of every title. Paths are shortened.

Give your coding agent the same facts

When a coding agent runs Retest, Retest notices. The output gets short, and ends with the next command to run.

Every run also writes versioned events, one JSON object per line, with a published JSON Schema. Here is one, shortened:

retest inspect reads a run folder without running anything again. A run that was cut off can never read as a pass.

What makes it different

  • It says what happened, not what it hopes happened. A test with no assertions fails. A forgotten await fails and names its line. If the browser dies after a click was sent, the result is "outcome unknown", never a guess.
  • Real input. A click goes through the mouse at the element's centre, after checking it is visible, still, enabled and not covered. A covered button is refused. Nothing is force-clicked.
  • Checks look again. Actions never repeat. An assertion keeps reading the page until its deadline. A click is sent once.
  • Made for agents from the start. Finite commands, stable test ids, exit codes that mean something (0, 1, 2, 130, 143), and output an agent can act on.
  • Nothing hidden. No account and no telemetry. Nothing downloads unless you run retest install. Screenshots stay on your machine unless an AI check sends one to the judge you chose.
  • Zero runtime dependencies. The AI SDK packages are optional peers, loaded only by a judge that uses them.

Documentation

Contributing

Read CONTRIBUTING.md before you open a pull request.

From the team behind Rehearsal

Retest is built by Rehearsal, where an agent writes your tests, keeps them working and reports on every pull request. You never need Rehearsal to use Retest.

License

Apache-2.0