فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

fix(qa): count each visible form field by DOM ordinal instead of collapsing unlabeled inputs

davoodmehraban89 committed Oct 30, 2026 at 23:38 UTC b2e88e5ba4c3f5781784cf4436f3a91386a0befe
1 file changed +4 -2
tests/windows-vm-ui-interaction-audit-browser.js
+4 -2
@@ -38,20 +38,22 @@
38 )].filter(isVisible);
39 function auditFields(root, route, section) {
40 if (!root) return;
41 + let fieldIndex = 0;
42 for (const field of root.querySelectorAll(
43 'input:not([type="hidden"]), select, textarea'
44 )) {
45 + const ordinal = fieldIndex++;
46 if (!isVisible(field)) continue;
47 const labels=field.labels ? [...field.labels] : [];
48 const explicit=!!field.getAttribute('aria-label') ||
49 !!field.getAttribute('aria-labelledby') ||
50 !!field.closest('label') || labels.length > 0;
51 const id=field.id||'';
50 - const key=[route,section,field.tagName.toLowerCase(),id,
52 + const key=[route,section,ordinal,field.tagName.toLowerCase(),id,
53 field.getAttribute('name')||'',field.getAttribute('type')||''].join('|');
54 if (fields.has(key)) continue;
55 fields.set(key,{
54 - route,section,id,tag:field.tagName.toLowerCase(),
56 + route,section,ordinal,id,tag:field.tagName.toLowerCase(),
57 type:field.getAttribute('type')||'',
58 label:labels.map(x=>x.textContent.trim().slice(0,75)).join(' / ') ||
59 field.getAttribute('aria-label') || '',