When clicking toolbar buttons like "Добавить" that put focus into a grid
INPUT cell, skip the 10-second waitForSelector for modal/balloon since
no server round-trip is expected. Also replace fixed waits with polling
in fillTableRow add/row paths. Total: 121s → 62s on composite test suite.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded waitForTimeout calls with polling loops that check
DOM state and exit early. Saves ~12s on composite-type test suite.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When filling composite-type cells (String+Number+Date), the previous code
tried paste first and only fell back to type selection if paste was rejected.
This failed when rows inherited a type from previous rows — paste succeeded
but the value was silently converted to the wrong type.
Now when { value, type } is specified:
1. Always clear the cell first (Shift+F4) to reset inherited type
2. Open type dialog (F4) and select the requested type
3. Dismiss calculator/calendar popups with Escape
4. Re-enter edit mode if focus was lost, then paste the value
Tested with primitive types (Число/Строка/Дата) and reference types
(Физическое лицо via selection form). Regression-tested existing
composite-type flow in Операции.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cells accepting multiple types (e.g. subconto on account 80.01) now
handled via { value, type } syntax. Paste rejection detected
automatically — F4 opens type dialog, picks type, then selects value
from the catalog form.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
selectValue now accepts search as object { field: value } for per-field
disambiguation in selection forms. All fields use advanced search (Alt+F)
by specific column — more efficient than simple full-text search on large
tables, and navigates to exact row even in virtual grids.
Also fixes filterList modal cleanup: now checks specific dialog form
instead of generic modalSurface, preventing accidental closure of
parent modal forms (e.g. selection forms).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When multiple types match the search term in the type selection dialog,
throw a descriptive error listing all matches instead of silently
picking the first one. This prevents the model from getting a misleading
"not found" error when the wrong type was selected.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `{ type }` option to selectValue for fields that accept multiple
types (e.g. DocumentRef.*). When specified, selectValue navigates
through the type selection dialog via Ctrl+F search before opening
the value selection form. Auto-detects composite fields when type
is not specified and throws a helpful error message.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
navigateSection() now gives a clear error message when the section
panel is in icon-only mode instead of a confusing "not found" error.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check form change before checkForErrors() to prevent misidentifying
a small EPF form (< 20 elements) as an informational modal dialog.
Only call checkForErrors() on suspiciously tiny new forms.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After clicking "Да" on the security confirmation, check for a second
informational modal ("please re-open the file"). If present, dismiss it
and retry the full Ctrl+O → filechooser cycle.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Opens EPF/ERF files via Ctrl+O → 1C file dialog → native file picker.
Handles security confirmation dialog with up to 2 attempts for re-open.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Caption timestamps now use actual video timeline position (frame
counter) instead of wall-clock time, eliminating sync drift from
non-uniform frame duplication in CDP screencast recordings.
Also replace silence-file concatenation with adelay+amix for
sample-accurate TTS placement, and fix exec timeout for long
scenarios (fetch → http.request with 10min timeout).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Screencast frame duplication (Math.round) causes video to be ~5% longer
than wall-clock time. Caption timestamps are wall-clock based, so the
audio track drifted ahead by ~8s at the midpoint of a 5-minute video.
Fix:
- stopRecording() saves recordingDuration in captions.json
- addNarration() reads actual video duration via ffprobe and scales
caption timestamps by videoDuration/recordingDuration ratio
- Phase 2 timeline now tracks actual cumulative position instead of
computing gaps from previous caption data (prevents MP3 frame
quantization drift)
- Also fixed findFfmpeg() → resolveFfmpeg() call in addNarration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mirrors resolveFfmpeg() pattern: tries global/project-level import
first, then tools/tts/node_modules/, then throws error with install
instructions. Caches resolved module for subsequent calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- node-edge-tts installed in tools/tts/ (alongside tools/ffmpeg/)
- Speed up TTS with ffmpeg atempo when it exceeds gap to next caption,
instead of hard-cutting the audio
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dynamic import needs file:// URL on Windows and explicit entry point
for ESM resolution. Package installed in tools/ alongside ffmpeg.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
showCaption() collects captions with optional speech parameter,
stopRecording() saves .captions.json, addNarration() generates
TTS voiceover (Edge TTS or OpenAI) and merges audio with video.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JPEG full range (0-255) was tagged as pc/full in H.264 output, but most
players (VLC, etc.) expect limited range (16-235). Convert JPEG→limited
with scale filter and tag as tv. Also switch preset ultrafast→fast for
5-6x smaller files on static screen content.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the function panel is open over a form, highlight() was finding
buttons from the hidden form instead of visible commands on the panel.
Move command search (cmd_XXX_txt) to step 1 — before form-scoped
search — so visible panel commands always take priority. Form elements
searched at step 2 only if no command matched.
Highlight search order is now:
0. Open submenu/popup (elementFromPoint overlay)
1. Commands on function panel (visible cmd_ elements)
2. Form elements (buttons, fields, grid rows)
3. Sections (sidebar navigation)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add submenu/popup as priority 0 in highlight() — checks open
popups before form search, preventing false matches on grid rows
behind the popup overlay
- Use elementFromPoint + direct overlay for submenu items instead
of getElementById (1C duplicates IDs in cloud popups — hidden
copy in form + visible copy in cloud)
- Add startsWith step between exact and includes for section and
command matching — fixes "Поступление" matching "Поступление
билетов" instead of "Поступление (акты, накладные, УПД)"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move unhighlight() before the fill action in fillFields — prevents
our overlay staying visible while platform focus moves to next field
on Tab/Enter. Consistent with clickElement/selectValue pattern:
highlight → wait → unhighlight → action.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Reorder highlight() search: form elements first, sections/commands as
fallback. Fixes false match where "ОК" matched section "Покупки" via
substring .includes() ("пок" contains "ок")
- Unhighlight before action in clickElement/selectValue (was only in
finally block, causing overlay to cover modals opened by the click)
- Add auto-highlight support to navigateSection and openCommand
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JPEG frames from CDP screencast use full range (0-255) but H.264
defaults to limited range (16-235). Add -color_range pc to preserve
full range in output MP4, fixing washed-out/bright appearance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Full-screen overlay with gradient background, centered title text,
optional subtitle. Useful for intro/outro frames in video recordings.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three improvements to browser automation reliability:
1. ё→е normalization: fuzzy matching now treats ё and е as equivalent
across all comparison points in both dom.mjs (norm() functions,
target variables) and browser.mjs (popup, radio, EDD, grid, confirmation
dialog, advanced search, filter badges). Prevents silent failures when
script uses ё but 1C displays е or vice versa.
2. DLB intercept handling in selectValue(): added force click + Escape
fallback when funcPanel overlay blocks the dropdown button click,
matching the pattern already used in clickElement().
3. Error handling: all exported functions now throw Error instead of
returning { error } objects. Error messages include function name,
what was searched, and available alternatives. Scenarios fail fast
at the broken step; interactive callers can use try/catch.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CDP screencast sends frames only on screen changes, causing ffmpeg
to compress pauses and produce sped-up video. Now duplicates the
previous frame to fill timing gaps, maintaining real-time speed.
Also add *.mp4 to .gitignore alongside *.png.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use direct gyan.dev URL instead of generic ffmpeg.org. Rewrite recording.md
prerequisites as clear alternatives (project / global / config).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New functions: startRecording, stopRecording, isRecording, showCaption, hideCaption.
Recording guide in recording.md with setup, API, examples, troubleshooting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fillFields({ 'Склад': 'value' }) now auto-resolves via DCS pair label
and auto-enables the checkbox. getFormState() returns reportSettings
array with readable names instead of raw КомпоновщикНастроек... fields.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reports and DataProcessors need e1cib/app/ prefix (opens app form),
while lists/registers/catalogs use e1cib/list/ (opens list form).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes:
- Scope iframe scanning to current form container (prevents reading
stale data from other open report tabs)
- Improved header detection: use LAST row before data as detail header,
previous row as group header with fill-forward for merged cells.
Fixes two-level headers like "Начальный остаток / Долг клиента"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parse SpreadsheetDocument into { title, meta, headers, data, totals }:
- Auto-detect header row (most non-empty before first numeric row)
- Group header prefix for duplicate column names (Сейчас/Доступно)
- Data rows as objects {column: value}, only non-empty cells
- Separate totals row (Итого/Всего)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reads 1C SpreadsheetDocument (report output) rendered in iframes.
Collects cells from div[x]/div[y] elements across all frames,
returns { rows: string[][], total }.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Auto-prepend e1cib/list/ when missing
- Translate English type names to Russian (AccumulationRegister → РегистрНакопления, etc.)
- Accepts: full e1cib/..., short Тип.Имя, or English Type.Имя
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- navigateLink(url): opens form via Shift+F11 dialog with clipboard paste
- Grant clipboard-read/write permissions on browser context creation
- Register navigateLink in ACTION_FNS for auto-error detection
- Document in SKILL.md with examples (e1cib/list/...)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
closeForm now accepts { save: true/false } option:
- save: false → clicks "Нет" on "Save changes?" dialog
- save: true → clicks "Да" to save and close
- undefined → returns confirmation as hint (previous behavior)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Action functions now call dismissPendingErrors() at start, so a leftover
error modal from a previous operation doesn't block subsequent actions.
Diagnostic functions (getFormState, screenshot) are unchanged — they
show current state as-is.
Key fixes:
- Target OK button within modal's form container (#formN_container)
to avoid clicking wrong pressDefault on the page
- Use force:true click to bypass #modalSurface pointer intercept
- Replace local dismissErrors() in fillReferenceField with shared fn
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two problems solved:
1. Server-side exceptions (ВызватьИсключение in ПередЗаписью) produce modal dialogs
AFTER the DOM stabilizes. clickElement now uses waitForSelector with MutationObserver
(doesn't block JS event loop) to detect #modalSurface or .balloon appearance.
2. checkErrorsScript used button IDs to determine form ownership, but 1C modal dialog
buttons often have empty IDs. Now uses closest('[id$="_container"]') ancestry to
group pressButtons by form, correctly separating modal buttons from background form
buttons (e.g. "Зачет оплаты" in ERP order form).
Tested with ТестОшибки CFE extension on ERP — error detected in 7.7s.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Selection forms without a search field (e.g. ERP Соглашения) have only
filter fields like ТипСоглашения. The old code fell back to inputs[0],
typing the search text into the filter field and breaking the form.
Now pickFromSelectionForm only uses inputs whose ID matches known search
field patterns (поиск/search/строкапоиска/SearchString/find). When no
search input is found, it skips text entry and matches rows directly in
the grid — which works because the target value is visible among the rows.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
selectValue: try DLB button first, fallback to CB (Choose Button).
ERP uses _CB suffix instead of _DLB for some reference fields
(Соглашение, Склад).
fillTableRow: handle non-INPUT focus between grid cells. ERP's
div-based grid puts DIV.gridBody focus between editable cells on Tab.
Also treat TEXTAREA cells (e.g. Содержание) as editable grid cells.
Added wrap-around detection to exit when Tab loops back to first cell.
Tested: Заказ клиента in ERP — all fields fill correctly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Smart wait polling showed no measurable speedup in benchmarks
(31.8s vs 32.0s baseline). 1C backend response time (~1.5-2s per
autocomplete) is the real bottleneck, not client-side delay calibration.
Reverted all 5 replacements to original fixed delays to reduce complexity.
Kept waitForCondition() utility for potential future use.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add waitForCondition() utility — polls JS expression every 100ms with
timeout fallback. Replace key fixed delays:
- fillReferenceField paste: 2000ms → poll for EDD/cloud (max 2s)
- fillTableRow add: 1000ms → poll for grid INPUT focus (max 2s)
- fillTableRow cell paste: 1500ms → poll for EDD/value (max 1.5s)
- fillTableRow Tab skip/commit: 300-1000ms → poll for focus change
Benchmark: 31.8s vs 32.0s baseline — no measurable speedup because
1C backend response time (~1.5-2s for autocomplete) is the real
bottleneck, not our delay calibration. Code is correct and will
benefit from faster backends.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Escape on document forms triggers "save changes?" dialog. Reorder
retry strategy: try force:true first (no side effects), then Escape
as fallback. Applied to both clickElement and fillReferenceField.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- detectFormScript: lower modal threshold from >=2 to >=1 visible elements
- clickElement: force:true on third retry when surface overlay persists
- filterList/unfilterList: add SearchString pattern for selection forms
- fillTableRow: wrap body in try/catch for structured error returns
- SKILL.md: add keyboard shortcuts reference (F8, Shift+F4, F4, Alt+F)
- gitignore: exclude *.png screenshot artifacts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move browser.mjs, dom.mjs, run.mjs from external 1c-web-client-mcp
project into .claude/skills/web-test/scripts/. Now the skill is
self-contained — copy .claude/skills/ + npm install is all that's
needed.
- Add scripts/package.json with playwright dependency
- Update SKILL.md with relative runner path and setup section
- Add node_modules/ and .browser-session.json to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>