From df47128994241e1afd0917e70a6f532e45f3ba6d Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Fri, 20 Mar 2026 15:22:44 +0300 Subject: [PATCH] fix(web-test): route reference fields without DLB through selectValue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference fields with pick button (_CB) but no dropdown button (_DLB) were going through the plain paste path, which silently failed for non-editable fields. Now detected via hasPick flag in resolveFieldsScript and delegated to selectValue (F4 → selection form). Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/skills/web-test/scripts/browser.mjs | 10 +++++++++- .claude/skills/web-test/scripts/dom.mjs | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.claude/skills/web-test/scripts/browser.mjs b/.claude/skills/web-test/scripts/browser.mjs index 72c6c0ad..fc0b6267 100644 --- a/.claude/skills/web-test/scripts/browser.mjs +++ b/.claude/skills/web-test/scripts/browser.mjs @@ -1532,9 +1532,17 @@ export async function fillFields(fields) { results.push({ field: r.field, error: 'option_not_found', available: r.options.map(o => o.label) }); } } else if (r.hasSelect) { - // Reference field: DLB-based selection (dropdown or selection form) + // Combobox/reference with DLB: DLB-first, then paste fallback const refResult = await fillReferenceField(selector, r.field, fields[r.field], formNum); results.push(refResult); + } else if (r.hasPick) { + // Reference field without DLB (non-editable): delegate to selectValue (F4 → selection form) + const svResult = await selectValue(r.field, String(fields[r.field])); + if (svResult?.error) { + results.push({ field: r.field, error: svResult.error, message: svResult.message }); + } else { + results.push({ field: r.field, ok: true, value: svResult.value || String(fields[r.field]), method: svResult.method || 'form' }); + } } else { // Plain field: clipboard paste + Tab to commit // page.fill() sets DOM value but doesn't trigger 1C input events; diff --git a/.claude/skills/web-test/scripts/dom.mjs b/.claude/skills/web-test/scripts/dom.mjs index 3889952c..854cbf53 100644 --- a/.claude/skills/web-test/scripts/dom.mjs +++ b/.claude/skills/web-test/scripts/dom.mjs @@ -1159,6 +1159,7 @@ export function resolveFieldsScript(formNum, fields) { const label = (titleEl?.innerText?.trim() || '').replace(/\\n/g, ' ').replace(/:$/, ''); const last = { inputId: el.id, name, label }; if (document.getElementById(p + name + '_DLB')?.offsetWidth > 0) last.hasSelect = true; + if (document.getElementById(p + name + '_CB')?.offsetWidth > 0) last.hasPick = true; allFields.push(last); }); // Checkboxes @@ -1236,6 +1237,7 @@ export function resolveFieldsScript(formNum, fields) { if (found.isCheckbox) { entry.isCheckbox = true; entry.checked = found.checked; } if (found.isRadio) { entry.isRadio = true; entry.options = found.options; } if (found.hasSelect) entry.hasSelect = true; + if (found.hasPick) entry.hasPick = true; if (found._dcsCheckbox) { entry.dcsCheckbox = { inputId: found._dcsCheckbox.inputId, checked: found._dcsCheckbox.checked }; delete found._dcsCheckbox;