1---2name: test-authoring3description: Проектирование тестов 1С: YaXUnit и Vanessa Automation. Используй когда нужно написать тест, подобрать сценарии или подготовить all/module запуск; сам запуск тестов на поверхности v0.13 не опубликован и остаётся отдельным шагом.4---56# Test Authoring78## MCP routing910- Preferred path: use MCP `unica` tools `unica.search`, `unica.view {}`, and `unica.check`.11- Runtime идёт через `unica.run`: вызов без `op` отдаёт словарь операций и12контракт каждой — `argsSchema`, `execution`, `previewRequired`,13`ifRevRequiredOnApply`. Контракт вызова бери оттуда, а не из этого текста;14выбирай только операцию с `implemented: true` и не выдумывай аргументов15записи с `argsSchema: null`; превью исполнением не является. Не обходи16контракт прямым runner-ом.17- Use `unica.docs` with `source: "development-standard"` only when test design depends on a `development-standard`. Expected platform API or mechanics require `unica.docs` with `source: "platform-help"`.18- Do not call internal runtime, analyzer, or package adapters directly. They are hidden behind MCP `unica`.1920## Workflow21221. Define the behavior under test before choosing the framework: pure BSL unit, object lifecycle, form behavior, integration contract, or regression around a diagnostic.232. Search existing tests and fixtures with `unica.search`; follow local naming, setup, teardown, and assertion style.243. Prefer YaXUnit for module/unit-level BSL behavior and Vanessa Automation for UI/business scenarios that require a client.254. Build the smallest stable fixture. Avoid dependence on production data unless the user explicitly requests an integration test.265. Check the new test module with `unica.check {at}` after adding test code (`unica.check {}` alone judges workspace readiness); a YaXUnit or Vanessa Automation run is not on the v0.13 surface, so it is not launched from here.276. Report that runtime verification was not performed. If separate test evidence is supplied, report the exact failing test, expected/actual behavior, and whether the failure is test setup or product behavior.2829## Verification gate3031- For implementation plans, every stated behavior gets either an executable test,32 a syntax/diagnostic check, or an explicit residual risk.33- For public API, integration, release, or metadata behavior, include impact34 analysis evidence from the relevant `unica.*` tools before treating the test35 plan as complete.36- Do not call donor-specific check commands. Use `unica.check {at}` on the module and37 `unica.view` on the object for available static checks; a test run38 needs separate execution evidence.3940## Scenario design4142- Read `../../references/platform/integration-contracts.md` when tests verify HTTP/API/OData/JSON/XML/file-exchange behavior.43- Read `../../references/platform/runtime-diagnostics.md` when a test is meant to reproduce a user-facing runtime failure.44- Treat tests as executable debugging: one test should prove the intended user/API scenario, the failure mode, and the regression boundary.45- For API scenarios, cover success, validation error, auth error, duplicate/idempotent retry, remote timeout, and stable error semantics.46- For UI or web-client scenarios, name the 1C test suite run as a separate step. Hand a concrete autonomous URL to an external browser-testing tool only when that URL and its running environment were supplied independently.4748## MCP example4950```json51{52 "jsonrpc": "2.0",53 "method": "tools/call",54 "params": {55 "name": "unica.check",56 "arguments": {57 "at": "main:CommonModule.ТестДокументаЗаказКлиента"58 }59 }60}61```