mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-11 13:33:41 +03:00
feat(web-test): DCS report settings — human-readable labels for fillFields/selectValue/getFormState
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>
This commit is contained in:
@@ -992,6 +992,11 @@ export async function fillFields(fields) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
// Auto-enable DCS checkbox if resolved via label
|
||||
if (r.dcsCheckbox && !r.dcsCheckbox.checked) {
|
||||
await page.click(`[id="${r.dcsCheckbox.inputId}"]`);
|
||||
await waitForStable();
|
||||
}
|
||||
const selector = `[id="${r.inputId}"]`;
|
||||
if (r.isCheckbox) {
|
||||
// Checkbox: compare desired with current, toggle if mismatch
|
||||
@@ -1325,6 +1330,14 @@ export async function selectValue(fieldName, searchText) {
|
||||
}
|
||||
if (btn?.error) return btn;
|
||||
|
||||
// Auto-enable DCS checkbox if resolved via label
|
||||
if (btn.dcsCheckbox) {
|
||||
const cbSel = `[id="${btn.dcsCheckbox.inputId}"]`;
|
||||
const isChecked = await page.$eval(cbSel, el =>
|
||||
el.classList.contains('checked') || el.classList.contains('checkboxOn') || el.classList.contains('select'));
|
||||
if (!isChecked) { await page.click(cbSel); await waitForStable(); }
|
||||
}
|
||||
|
||||
// Helper: detect selection form (form number > formNum)
|
||||
async function detectSelectionForm() {
|
||||
return page.evaluate(`(() => {
|
||||
|
||||
Reference in New Issue
Block a user