mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-06 11:40:20 +03:00
fix(web-test): don't treat small data forms as error modals
checkErrorsScript falsely classified small forms (e.g. register record form opened by "Установить статус") as error modals because they had < 100 elements + a pressDefault button + staticText. Added input field check — forms with editInput elements are data entry forms, not errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
298589d7cc
commit
f93a1560a5
@@ -905,12 +905,16 @@ export function checkErrorsScript() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Single-button modal: error dialog with pressDefault + staticText
|
// Single-button modal: error dialog with pressDefault + staticText
|
||||||
|
// Skip forms with input fields — those are data entry forms (e.g. register record),
|
||||||
|
// not error dialogs. Real error modals only have staticText + buttons.
|
||||||
if (!result.confirmation) {
|
if (!result.confirmation) {
|
||||||
for (const [fn, buttons] of Object.entries(formButtons)) {
|
for (const [fn, buttons] of Object.entries(formButtons)) {
|
||||||
const p = 'form' + fn + '_';
|
const p = 'form' + fn + '_';
|
||||||
const elCount = document.querySelectorAll('[id^="' + p + '"]').length;
|
const elCount = document.querySelectorAll('[id^="' + p + '"]').length;
|
||||||
if (elCount > 100) continue;
|
if (elCount > 100) continue;
|
||||||
if (buttons.length !== 1 || !buttons[0].classList.contains('pressDefault')) continue;
|
if (buttons.length !== 1 || !buttons[0].classList.contains('pressDefault')) continue;
|
||||||
|
const hasInputs = document.querySelectorAll('input.editInput[id^="' + p + '"]').length > 0;
|
||||||
|
if (hasInputs) continue;
|
||||||
const texts = [...document.querySelectorAll('[id^="' + p + '"].staticText')]
|
const texts = [...document.querySelectorAll('[id^="' + p + '"].staticText')]
|
||||||
.filter(el => el.offsetWidth > 0)
|
.filter(el => el.offsetWidth > 0)
|
||||||
.map(el => el.innerText?.trim())
|
.map(el => el.innerText?.trim())
|
||||||
|
|||||||
Reference in New Issue
Block a user