api-scenario-runner Executes Full Business-Chain API Tests with Three-Level Assertions and CI-Ready Compilation
End-to-end API testing now has an AI-driven path that treats a whole business flow as the unit under test, not isolated endpoints. That means fewer surprises in production where every endpoint works but the checkout still fails, and it turns scenario definitions into executable, CI-friendly pytest code.
All the single-interface tests can pass while the business flow still breaks. api-scenario-runner closes that gap by treating the whole chain from registration to order query as one test scenario. It reads a scenario YAML file, sends requests in sequence, auto-extracts and injects variables, and adds Bearer token headers where needed.
Assertions run at three levels: status code, business code, and JSONPath, plus a terminal DB state check that only allows SELECT with parameterized SQL. Failure stops execution and a snapshot file records the real request, response, and variables after injection, with sensitive values masked. Failures classify into five categories: missing variable, assertion failure, API error, connection error, and DB error.
Two execution modes exist: direct run and compile to a pytest project. Compiled scripts drop into the existing test hierarchy, schedule through api-test-executor, and feed a pipeline that includes cleanup and reporting. A dedicated idempotency round proves a second run goes green without changes, thanks to dynamic timestamp usernames and proper data cleanup, separating CI-viable tests from flaky ones.
Moving from single-interface tests to whole business chains catches integration failures that unit-style API tests miss, like a token that doesn't propagate from login to order.
The idempotency round is the real gate for CI adoption; most test suites fail on repeated runs due to state pollution, and dynamic data plus cleanup is the solution.
Compiling scenario YAML to pytest bridges declarative AI-driven test design with existing test infrastructure, letting teams adopt the approach without abandoning their current runners and reporters.
The discussion focuses on the guardrails built into the Skill system and on aligning verification granularity with business granularity. Both comments treat single-interface green status as insufficient, arguing that global chain control must be verified first. The split of scenario modeling and chain execution into separate Skills is seen as a sound way to separate the 'what' from the 'how'. One comment adds that even 99.99% end-to-end success leaves a 0.01% gap that demands one-click rollback, failure replay, and per-step logging to avoid production incidents.
What impresses me most about this Skill system isn't the coverage, but those guardrails: DB assertions only allow SELECT, SQL parameterization, orchestration files forbid hardcoded connection strings, fail-fast preserves the scene, and sensitive values are masked in snapshots. The stronger the capability, the more it tests whether the boundaries are drawn clearly enough. In the end, agent automation often isn't about how much it can do, but whether there's a scene preserved when it errs, and whether it's blocked when it oversteps. A single interface being all green while the business chain stalls is essentially the same thing: local controllability isn't global controllability. Treating the chain as a whole test is a way of first verifying controllability, then discussing automation.
A single interface all green yet the business still stalls—that pitfall is all too real: the granularity of acceptance has to align with the granularity of the business. Splitting scenario modeling and chain execution into two Skills, each managing what to test and how to run, is a clever combination. One more point: end-to-end 99.99% is already strong, but that 0.01% is often dirty data left by cross-service state inconsistency; the chain still needs one-click rollback, failure replay, and logs at every step, otherwise no matter how high the coverage, you fear production blowing up.