From 24a48b4a9f8d7ea5b1b97143d965d23de37016b8 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sat, 14 Mar 2026 12:11:10 +0300 Subject: [PATCH] =?UTF-8?q?fix(web-test):=20add=20=D0=93=D1=80=D1=83=D0=BF?= =?UTF-8?q?=D0=BF=D0=B0+name=20fallback=20for=20grid=20label=20extraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some forms, #title_div is on the parent group element (e.g. form0_ГруппаБизнесПроцессы#title_div) rather than on the grid itself. Add fallback lookup for both getFormState and resolveGridScript. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/web-test/scripts/dom.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.claude/skills/web-test/scripts/dom.mjs b/.claude/skills/web-test/scripts/dom.mjs index 4d560022..2a5f2419 100644 --- a/.claude/skills/web-test/scripts/dom.mjs +++ b/.claude/skills/web-test/scripts/dom.mjs @@ -205,7 +205,8 @@ const READ_FORM_FN = `function readForm(p) { } const rowCount = body ? body.querySelectorAll('.gridLine').length : 0; // Visual label from group title (e.g. "Входящие:" for grid "Входящие") - const titleEl = document.getElementById(p + name + '#title_div'); + const titleEl = document.getElementById(p + name + '#title_div') + || document.getElementById(p + 'Группа' + name + '#title_div'); const label = titleEl ? (titleEl.innerText?.trim().replace(/:\\s*$/, '').replace(/\\u00a0/g, ' ') || null) : null; return { name, columns, rowCount, ...(label ? { label } : {}) }; }); @@ -395,7 +396,8 @@ export function resolveGridScript(formNum, tableName) { }); } // Visual label from group title element - const titleEl = document.getElementById(p + gridName + '#title_div'); + const titleEl = document.getElementById(p + gridName + '#title_div') + || document.getElementById(p + 'Группа' + gridName + '#title_div'); const label = titleEl ? (titleEl.innerText?.trim().replace(/:\s*$/, '').replace(/\u00a0/g, ' ') || '') : ''; return { idx, gridId, gridName, label, columns, el: g }; });