feat: add scroll to bottom before processing and enable form submission in save_form
This commit is contained in:
@@ -771,6 +771,10 @@ class SigaDespesasAutomation:
|
||||
target_option_text=expense.forma_pagamento,
|
||||
)
|
||||
|
||||
# Faça scroll to bottom
|
||||
await page.mouse.wheel(0, 10000)
|
||||
await human_delay(300, 600)
|
||||
|
||||
# 10.1 Validação do Campo Conta (Auto-preenchido pelo SIGA ao escolher DÉBITO AUTOMÁTICO)
|
||||
conta_field = page.locator("#s2id_f_conta .select2-chosen, #s2id_f_id_conta .select2-chosen").first
|
||||
if await conta_field.is_visible():
|
||||
@@ -918,7 +922,7 @@ async def main():
|
||||
await automation.process_expense(rec)
|
||||
|
||||
# C. Clica em Salvar (Modo Simulação: MANTIDO click_save=False para NUNCA submeter em produção)
|
||||
await automation.save_form(click_save=False)
|
||||
await automation.save_form(click_save=True)
|
||||
|
||||
success_count += 1
|
||||
logger.info(f"🎉 [{idx}/{total_records}] SUCESSO: Data {rec.data_documento.strftime('%d/%m/%Y')} | Doc {rec.numero_documento} | R$ {rec.valor_documento:.2f}")
|
||||
|
||||
Reference in New Issue
Block a user