mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-26 06:31:02 +03:00
fix(web-test): require Message element for confirmation detection
Forms with multiple buttons but no form{N}_Message element were
falsely detected as confirmation dialogs. Real 1C confirmations
(Да/Нет) always have a Message element. Now skip forms without it.
Fixes false positives on small EPF forms with custom buttons.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1b37bad331
commit
90b3d5d2e9
@@ -889,8 +889,11 @@ export function checkErrorsScript() {
|
|||||||
if (elCount > 100) continue; // Skip large content forms
|
if (elCount > 100) continue; // Skip large content forms
|
||||||
if (buttons.length > 1) {
|
if (buttons.length > 1) {
|
||||||
// Confirmation dialog (multiple buttons: Да/Нет, OK/Отмена, etc.)
|
// Confirmation dialog (multiple buttons: Да/Нет, OK/Отмена, etc.)
|
||||||
|
// Must have a Message element — real 1C confirmations always have form{N}_Message.
|
||||||
|
// Without it, this is just a regular form with multiple buttons (e.g. EPF form).
|
||||||
const msgEl = document.getElementById(p + 'Message');
|
const msgEl = document.getElementById(p + 'Message');
|
||||||
const message = msgEl?.innerText?.trim() || '';
|
if (!msgEl || msgEl.offsetWidth === 0) continue;
|
||||||
|
const message = msgEl.innerText?.trim() || '';
|
||||||
const btnNames = buttons.map(el => {
|
const btnNames = buttons.map(el => {
|
||||||
const b = { name: el.innerText?.trim() || '' };
|
const b = { name: el.innerText?.trim() || '' };
|
||||||
if (el.classList.contains('pressDefault')) b.default = true;
|
if (el.classList.contains('pressDefault')) b.default = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user