UI and API in one end-to-end run
POST the cart sent and the price in the cart drawer.
- Start the objective on the API, for example
open https://your-app.com/api/shop/products and, from the JSON, record the title and price of the product with id 'sku_headset'. - Move to the UI in the same sentence, for example
open the product page for sku_headset and verify it shows the same title and price. - Act in the UI, for example
click 'Add to Cart'. - Check the request the click sent, for example
verify the POST to /api/cart returned 201 with 'sku_headset' in the request body. - Check the result on screen against the API value, for example
verify the cart drawer shows the headset at the price recorded from the API. - Run it with
--agent, and read the summary for each value Kane CLI recorded and compared.
Save once, replay on every build
kane-cli testmd list shows the committed tests, the first run of a package search test authors each step, and the next run replays both steps from the recording and passes.
-
Write the flow as a
_test.mdfile, with one##heading per step and a check at the end of each step:checkout_test.md -
Run it once with
kane-cli testmd run tests/checkout_test.md --agent. Kane CLI authors each step and writes the recording tooutput-checkout/. -
Commit the
_test.mdfile and itsoutput-checkout/folder, which is safe to commit. - Run it again on every build. Steps replay from the recording, which is faster and does not call the model, as long as the step text and config stay the same.
-
List what is committed and what has a recording with
kane-cli testmd list.
Recover when the UI changes
Renaming a button breaks every recorded locator that points at it. In this recording, a bank account sign-up test replays until the Continue button is renamed in the code, the replay fails on that step, and Kane CLI re-authors the step against the new button so the test passes again.- Make the UI change, for example rename Continue to Next step in your page component.
- Run the committed test as usual with
kane-cli testmd run tests/open-account_test.md --agent. - The replay of the changed step fails. Adaptive healing is on by default, so Kane CLI retries smaller replay windows and then re-authors the affected steps against the current page.
- The run passes on the new UI, and the refreshed recording replaces the old one. Commit the updated
output-<stem>/folder so CI replays the new recording. - If you would rather a replay failure stop the run, pass
--no-adaptive-heal.
This recording was made with an earlier release that used a
--retry flag. In current releases adaptive healing is on by default, and --retry is accepted but has no effect. See Handling replay failures.Promote a passing run to a committed test
An ad-hoc run that passed is already a good regression test, and it should not disappear when the terminal closes. This use case turns akane-cli run into a _test.md file in your repo.
- Rerun the objective that passed with a name, for example
kane-cli run "…" --name checkout-flow --agent. - Kane CLI writes a
_test.mdfile for the run to.testmuai/tests/and copies the run’s evidence pack into.testmuai/evidence/. - Move the file into your repo’s
tests/folder and add tags, for exampletags: [regression]. - Commit the file and its
output-<stem>/folder, then run the whole suite withkane-cli testrun run --tags regression --parallel 4 --headless.
Separate product bugs from test issues
A failing regression suite costs time when nobody knows whether the app broke or the test went stale. Kane CLI investigates every failed replay automatically, and bug detection can watch for product bugs while steps are authored.- Turn on bug detection for the run with
--bug-detection continue, or save it withkane-cli config set-bug-detection continue. - Run the suite. When the agent suspects a product bug, Kane CLI investigates it and either rejects it or confirms it.
- A confirmed product bug arrives in the NDJSON
run_endevent asresult_code740with averdictobject, and is recorded in the evidence pack. - For a failed replay, open the evidence pack and read the failure record, which holds the error, the page state at that moment, and links to the step’s console and network logs.
- Fix the app for a product bug, or edit the step’s text for a stale test, and rerun.
--bug-detection stop in CI when a confirmed product bug should end the run immediately. See Bug detection and Debugging with evidence.
Next steps
- CI/CD & DevOps Testing: run this suite on every push and on a schedule
- Test Generation & Exploration: design the cases before you write them
- Batch Runs: select, parallelize, and gate a suite
- Evidence: the record behind every pass and fail