From 70e684d189f746accebbac518b5acff0a8be589e Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 29 Mar 2026 19:17:25 +0300 Subject: [PATCH] feat(skill-tests): add form-add + form-compile steps to platform integration tests Now that ExtendedPresentation and InterfaceCompatibilityMode bugs are fixed, platform integration tests can include full form generation: - platform-config: form-add + form-compile for Catalog and Document forms - platform-epf: epf-add-form + form-compile with elements/attributes/commands - platform-cfe: form-add + form-compile for borrowed Catalog form Co-Authored-By: Claude Opus 4.6 (1M context) --- .../skills/integration/platform-cfe.test.mjs | 23 ++++++++++- .../integration/platform-config.test.mjs | 41 ++++++++++++++++++- .../skills/integration/platform-epf.test.mjs | 36 ++++++++++++++-- 3 files changed, 94 insertions(+), 6 deletions(-) diff --git a/tests/skills/integration/platform-cfe.test.mjs b/tests/skills/integration/platform-cfe.test.mjs index 342751fa..a689a62c 100644 --- a/tests/skills/integration/platform-cfe.test.mjs +++ b/tests/skills/integration/platform-cfe.test.mjs @@ -28,7 +28,28 @@ export const steps = [ args: { '-ConfigPath': '{workDir}/config', '-DefinitionFile': '{inputFile}' }, }, - // ── 2. Build extension (borrow without forms) ── + { + name: 'form-add: форма справочника', + script: 'form-add/scripts/form-add', + args: { + '-ObjectPath': '{workDir}/config/Catalogs/Контрагенты', + '-FormName': 'ФормаЭлемента', + '-Purpose': 'Object', + }, + }, + { + name: 'form-compile: наполнение формы справочника', + script: 'form-compile/scripts/form-compile', + input: { + elements: [ + { id: 'Код', type: 'input', path: 'Object.Code', title: 'Код' }, + { id: 'Наименование', type: 'input', path: 'Object.Description', title: 'Наименование' }, + ], + }, + args: { '-FormPath': '{workDir}/config/Catalogs/Контрагенты/Forms/ФормаЭлемента', '-JsonPath': '{inputFile}' }, + }, + + // ── 2. Build extension ── { name: 'cfe-init: расширение', script: 'cfe-init/scripts/cfe-init', diff --git a/tests/skills/integration/platform-config.test.mjs b/tests/skills/integration/platform-config.test.mjs index 3e2a8da5..cc6a2ebd 100644 --- a/tests/skills/integration/platform-config.test.mjs +++ b/tests/skills/integration/platform-config.test.mjs @@ -1,6 +1,6 @@ // platform-config.test.mjs — Integration test: load config into 1C platform // Requires: 1C platform (1cv8.exe) via .v8-project.json -// Steps: cf-init → meta-compile (objects without forms) → cf-edit → db-create → db-load-xml → db-update +// Steps: cf-init → meta-compile → form-add → form-compile → cf-edit → db-create → db-load-xml → db-update export const name = 'Загрузка конфигурации в платформу 1С'; export const setup = 'none'; @@ -34,6 +34,45 @@ export const steps = [ input: { type: 'Enum', name: 'Статусы', values: ['Новый', 'Выполнен'] }, args: { '-JsonPath': '{inputFile}', '-OutputDir': '{workDir}/config' }, }, + { + name: 'form-add: форма элемента справочника', + script: 'form-add/scripts/form-add', + args: { + '-ObjectPath': '{workDir}/config/Catalogs/Товары', + '-FormName': 'ФормаЭлемента', + '-Purpose': 'Object', + }, + }, + { + name: 'form-compile: наполнение формы справочника', + script: 'form-compile/scripts/form-compile', + input: { + elements: [ + { id: 'Код', type: 'input', path: 'Object.Code', title: 'Код' }, + { id: 'Наименование', type: 'input', path: 'Object.Description', title: 'Наименование' }, + ], + }, + args: { '-FormPath': '{workDir}/config/Catalogs/Товары/Forms/ФормаЭлемента', '-JsonPath': '{inputFile}' }, + }, + { + name: 'form-add: форма документа', + script: 'form-add/scripts/form-add', + args: { + '-ObjectPath': '{workDir}/config/Documents/Приход', + '-FormName': 'ФормаДокумента', + '-Purpose': 'Object', + }, + }, + { + name: 'form-compile: наполнение формы документа', + script: 'form-compile/scripts/form-compile', + input: { + elements: [ + { id: 'Склад', type: 'input', path: 'Object.Склад', title: 'Склад' }, + ], + }, + args: { '-FormPath': '{workDir}/config/Documents/Приход/Forms/ФормаДокумента', '-JsonPath': '{inputFile}' }, + }, { name: 'cf-edit: регистрация объектов', script: 'cf-edit/scripts/cf-edit', diff --git a/tests/skills/integration/platform-epf.test.mjs b/tests/skills/integration/platform-epf.test.mjs index cbdd2a64..22296f65 100644 --- a/tests/skills/integration/platform-epf.test.mjs +++ b/tests/skills/integration/platform-epf.test.mjs @@ -1,6 +1,6 @@ // platform-epf.test.mjs — Integration test: EPF build/dump roundtrip // Requires: 1C platform (1cv8.exe) via .v8-project.json -// Steps: epf-init (no forms) → epf-build → epf-dump +// Steps: epf-init → epf-add-form → form-compile → epf-build → epf-dump export const name = 'Сборка и разборка внешней обработки (roundtrip)'; export const setup = 'none'; @@ -14,7 +14,35 @@ export const steps = [ args: { '-Name': 'RoundtripТест', '-SrcDir': '{workDir}' }, }, - // ── 2. Build EPF binary ── + // ── 2. Add form to EPF ── + { + name: 'epf-add-form: форма обработки', + script: 'epf-add-form/scripts/add-form', + args: { + '-ObjectPath': '{workDir}/RoundtripТест.xml', + '-FormName': 'Форма', + }, + }, + + { + name: 'form-compile: наполнение формы обработки', + script: 'form-compile/scripts/form-compile', + input: { + elements: [ + { id: 'ПутьКФайлу', type: 'input', path: 'ПутьКФайлу', title: 'Путь к файлу' }, + { id: 'Загрузить', type: 'button', title: 'Загрузить', action: 'Загрузить' }, + ], + attributes: [ + { id: 'ПутьКФайлу', type: 'String' }, + ], + commands: [ + { id: 'Загрузить', title: 'Загрузить' }, + ], + }, + args: { '-FormPath': '{workDir}/RoundtripТест/Forms/Форма', '-JsonPath': '{inputFile}' }, + }, + + // ── 3. Build EPF binary ── { name: 'epf-build: сборка EPF', script: 'epf-build/scripts/epf-build', @@ -25,14 +53,14 @@ export const steps = [ }, }, - // ── 3. Create temp DB for dump (epf-dump requires database connection) ── + // ── 4. Create temp DB for dump ── { name: 'db-create: временная ИБ для разборки', script: 'db-create/scripts/db-create', args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/tmpdb' }, }, - // ── 4. Dump EPF back to XML ── + // ── 5. Dump back to XML ── { name: 'epf-dump: разборка EPF в XML', script: 'epf-dump/scripts/epf-dump',