diff --git a/.claude/skills/web-test/scripts/browser.mjs b/.claude/skills/web-test/scripts/browser.mjs index 1a51f0a5..8155256b 100644 --- a/.claude/skills/web-test/scripts/browser.mjs +++ b/.claude/skills/web-test/scripts/browser.mjs @@ -812,7 +812,7 @@ function normalizeE1cibUrl(url) { export async function openFile(filePath) { ensureConnected(); await dismissPendingErrors(); - const absPath = resolveProjectPath(filePath); + const absPath = resolveProjectPath(filePath.replace(/\\/g, '/')); const MAX_ATTEMPTS = 2; // 1st may trigger security dialog, 2nd is the real open for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) { diff --git a/.claude/skills/web-test/scripts/dom.mjs b/.claude/skills/web-test/scripts/dom.mjs index 963701d0..d02cbe7b 100644 --- a/.claude/skills/web-test/scripts/dom.mjs +++ b/.claude/skills/web-test/scripts/dom.mjs @@ -1,4 +1,4 @@ -// web-test dom v1.4 — DOM selectors and semantic mapping for 1C web client +// web-test dom v1.5 — DOM selectors and semantic mapping for 1C web client // Source: https://github.com/Nikolay-Shirokov/cc-1c-skills /** * DOM selectors and semantic mapping for 1C:Enterprise web client. @@ -14,7 +14,7 @@ * When modalSurface is visible — prefer the highest-numbered form (modal dialog). */ const DETECT_FORM_FN = `function detectForm() { const counts = {}; - document.querySelectorAll('input.editInput[id], a.press[id]').forEach(el => { + document.querySelectorAll('input.editInput[id], textarea[id], a.press[id]').forEach(el => { if (el.offsetWidth === 0) return; const m = el.id.match(/^form(\\d+)_/); if (m) counts[m[1]] = (counts[m[1]] || 0) + 1; @@ -36,7 +36,7 @@ const DETECT_FORM_FN = `function detectForm() { * Works even when the open-windows tab bar is hidden. */ const DETECT_FORMS_FN = `function detectForms() { const counts = {}; - document.querySelectorAll('input.editInput[id], a.press[id]').forEach(el => { + document.querySelectorAll('input.editInput[id], textarea[id], a.press[id]').forEach(el => { if (el.offsetWidth === 0) return; const m = el.id.match(/^form(\\d+)_/); if (m) counts[m[1]] = (counts[m[1]] || 0) + 1; @@ -1153,7 +1153,7 @@ export function checkErrorsScript() { const elCount = document.querySelectorAll('[id^="' + p + '"]').length; if (elCount > 100) continue; if (buttons.length !== 1 || !buttons[0].classList.contains('pressDefault')) continue; - const hasInputs = document.querySelectorAll('input.editInput[id^="' + p + '"]').length > 0; + const hasInputs = document.querySelectorAll('input.editInput[id^="' + p + '"], textarea[id^="' + p + '"]').length > 0; if (hasInputs) continue; const texts = [...document.querySelectorAll('[id^="' + p + '"].staticText')] .filter(el => el.offsetWidth > 0) diff --git a/.claude/skills/web-test/scripts/run.mjs b/.claude/skills/web-test/scripts/run.mjs index 0860d1a5..1566b7a4 100644 --- a/.claude/skills/web-test/scripts/run.mjs +++ b/.claude/skills/web-test/scripts/run.mjs @@ -1,5 +1,5 @@ #!/usr/bin/env node -// web-test run v1.2 — CLI runner for 1C web client automation +// web-test run v1.3 — CLI runner for 1C web client automation // Source: https://github.com/Nikolay-Shirokov/cc-1c-skills /** * CLI runner for 1C web client automation. @@ -168,6 +168,10 @@ async function executeScript(code, { noRecord } = {}) { }; } + // Normalize Windows backslash paths to prevent JS parse errors + // (e.g. C:\Users\... → \u triggers "Invalid Unicode escape sequence") + code = code.replace(/[A-Za-z]:\\[^\s'"`;\n)}\]]+/g, m => m.replace(/\\/g, '/')); + const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor; const fn = new AsyncFunction(...Object.keys(exports), code); await fn(...Object.values(exports));