Skip to content

feat(platform): run and read automation tests in the editor - #4811

Merged
yannickmonney merged 3 commits into
mainfrom
feat/automation-tests-panel
Oct 11, 2026
Merged

yannickmonney merged 3 commits into
mainfrom
feat/automation-tests-panel

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

The editor's Tests panel, the first slice of testing in the app (P5 S10a): an author sees the automation's tests under the canvas, runs them on the draft or on the version shown, reads what a failing test found, and writes tests as YAML. It builds on the test reports and bench routes of #4808.

The Tests panel

  • A Tests button beside Problems (its glyphs count passed, failed and couldn't-run) opens one dock with two tabs, Problems and Tests; on a phone each opens in a sheet. ?panel= and ?test= keep the panel and the open test in the address.
  • One row per test in the document's order: status, name, the first failure in words (one sentence per failure kind, EN/DE/FR), duration, and chips for the nodes and failures it simulates. The line above the list says where the results come from: Run on your draft, Checked when version N was saved / deployed, or Checked by hand, with the date.
  • Results of this page's runs are kept per automation in memory (the last ten automations). A result belongs to what it ran: the automation without its tests, and the test itself. Once either changes, the row reads Changed since this result and keeps its words; editing one test leaves the other tests' results standing. While nothing ran here, the rows read the version's kept report (migration 0200).
  • Run all and Run (row menu, open test) run on the draft (/run-tests with the document) or, without unsaved changes, on the version shown, where a whole run is recorded as checked by hand. A spent bench budget says how many seconds to wait and Run waits; a draft the checks refuse points at Problems; any other failure is said under its title. The announcer says Running N tests… and then the counts.
  • Add test appends a blank test, with a placeholder for each field the run input requires. A row's menu has Duplicate and Delete: focus moves to the next row, a screen reader hears the deletion, and Discard brings the test back. Results move with their tests.
  • An automation without tests shows the empty state with Add test.

The test inspector

  • Opens beside the canvas where a node's would (a sheet on a phone). Setup is the test as YAML: the draft takes a text that parses, keys this build doesn't know are kept, and the check's problems in the test are marked at their place. Result says what went wrong, one sentence per failure: output differences as expected X, got Y, what happened instead of an expected action, the node a run failed at with Show node, the stand-ins it used and didn't use, and the engine's words under Technical details.
  • Problems' "go to" for a problem in a test now opens that test with the place selected in its YAML; the Source-view fallback for tests is gone.

@tale/ui

  • DataDiff gains wording="expectation" (total: expected 2160, got 2280, 1 different, 1 missing), and honours options.mode: 'includes' (@tale/ui/data/value-diff already compared that way): fields the expectation doesn't name are no longer listed as unchanged, and a line counts them. EN/DE/FR strings; the guide documents the prop.

Docs, screenshots, manual

  • New page Test an automation (platform/automations/testing, EN/DE/FR) with a screenshot from the pipeline: a new demo, Order discounts, whose big-order test expects 10 % off where the code gives 5 %.
  • The editor page's Problems section and Save and test a version point to it. The concepts page said the deploy reads the result recorded at save; the deploy gate re-runs the tests, so it now says both.
  • Regenerated the ten editor screenshots whose toolbar gained Tests, with their alt texts.
  • Manual: AUTO-F164–AUTO-F169, AUTO-B25, AUTO-A25, and a reference row for the automated coverage.

Verification (local)

  • Platform tsc; oxlint on the changed files and the automations, routes and engine trees.

  • The whole server and PII projects: 87,742 of 87,743 pass. The one red, tests/guards/automation-legacy-agent-flow.test.ts, is red on main too (turn_budget.ts changed in 6d1e153 without its pinned hash); this branch touches neither file.

  • The whole platform UI suite: 7,497 of 7,497. Automations browser tests: 93 of 93 (the editor's 27 among them).

  • @tale/ui: tsc, oxlint, the whole unit project (4,094, the i18n orphan-key check included) and the DataDiff and test-results browser tests (101).

  • services/docs tests (709: links in every locale, locale parity, images, published addresses), services/ui-docs tests (106), lint:links, lint:manual, knip, format.

  • New tests: the controller hook (use-automation-tests.test.tsx, 9), the pure helpers (lib/automation-tests/*.test.ts), the panel and the inspector (components/automation-tests/*.test.tsx), five editor-level cases (AutomationEditor tests) and the reworked go-to-a-problem case, DataDiff's two wordings and the includes comparison.

  • Two guard findings fixed on the way: the i18n orphan-key scanner skips any tests/ directory, so the new folders are named automation-tests/; and a pure module that takes a translate function declares it inline so the scanner credits its keys.

  • Live in Chromium on a local stack (the weekly digest, 1440 px): empty state, Add test (the address gains ?panel=tests&test=0), a test expecting the wrong output fails with text: expected …, got …, editing it turns the row Changed since this result, Run alone passes it, a mistyped key reaches Problems and "go to" selects it in the YAML, Delete empties the list. At 390 px: one sheet at a time, closing a test returns focus to the Tests button. No console errors.

DataDiff takes wording="expectation": before is what was expected and after what came, so each change reads "total: expected 2160, got 2280" or "currency: expected \"CHF\", missing" and the counts read "1 different, 1 missing". It also honours options.mode 'includes', which value-diff already compared by: fields the expectation does not name are no longer listed as unchanged, and a line counts them. EN/DE/FR strings; the guide documents the prop.
A Tests button beside Problems opens the dock under the canvas on a Tests tab: one row per test with its status, first failure in words and duration, results kept per automation and marked changed since once the automation or the test changed, and a version's kept report while nothing ran. Run all and run one work on the draft or on the version shown, where a whole run is recorded as checked by hand; a spent budget or a refused draft is said in words. Add, copy and delete tests; a test opens beside the canvas with its YAML (Setup) and what its latest run found (Result). Problems go to a test's place in its YAML. The address keeps ?panel= and ?test=.
A new page, Test an automation (EN/DE/FR), with a screenshot from the pipeline: a demo order-discounts automation whose big-order test fails. The editor page sends test problems to the Tests panel and points to the page; the concepts page says the deploy gate runs the tests again rather than reading the result recorded at save. The ten editor screenshots whose toolbar gained Tests are captured again, with their alt texts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant