Agent Replay Caching for E2E Tests: How TesterArmy Records Once, Replays Until the App Changes
Описание и применение
Фреймворк TesterArmy записывает действия агента один раз и воспроизводит их, пока приложение не изменится, тем самым снижая стоимость токенов и повышая надёжность тестов.
Задача
Agent‑driven E2E tests are expensive and flaky because each run calls a language model and the model can produce different action sequences.
Результат
The replay cache reduces token cost to zero after the first run and makes tests deterministic until the app changes, while still allowing manual assertions to detect stale caches.
Рабочий процесс
- Write a natural‑language goal with agent.act()
- Framework records the resulting action sequence and locator snapshots on first run
- Store the sequence in a JSON cache file per test
- On later runs, check each locator against the current page
- If all locators resolve, replay cached actions
- If any locator fails, invalidate cache and call the agent again
Доказательства
TesterArmy's E2E framework solves the two hard problems of agent-driven testing: cost and flakiness.
On the first run, the framework records every action the agent takes. On subsequent runs, it replays those actions without calling the model until the app changes enough to invalidate the recording.
The framework does not store DOM snapshots. It stores action sequences and the locators that triggered them.
If an assertion fails after a replayed action, the test fails, and you know the cache is stale.
- Дата записи: 2026-10-05T21:41:00.971Z