o
    B_i                     @   sL   d dl mZ ddlmZ ddlmZ dedefddZdedefd	d
ZdS )    )Page   )shot)log_steppagereturnc                 C   s   |  d}| dkrdS z	|jjdd}W n ty$   | d}Y nw |dkr+dS t| |d td|  |  d	j}|jd
d | j	ddd t| |d td|  z
| j
ddd W dS  tyh   Y dS w )z]
    Maneja el modal 'User Session Limit'.
    Retorna True si fue detectado y manejado.
    z#postLoginTyper   Fi  )timeoutz5document.querySelector('#postLoginType')?.value || ''terminateSessionszterminateSessions-detectedz)form#frmPostLogin button.af-btn--seaGreeni  z() => {
            const el = document.querySelector('#postLoginType');
            return !el || el.value !== 'terminateSessions';
        }i:  zterminateSessions-afternetworkidleT)locatorcountfirstinput_value	Exceptionevaluater   r   clickwait_for_functionwait_for_load_state)r   run_dir
post_loginvaluebtn r   U/var/www/html/flask_server/apps/aroflo_connector_app/ui_automation/auth/post_login.pyhandle_terminate_sessions   s:   


r   c                 C   s
   t | |S )N)r   )r   r   r   r   r   $handle_terminate_sessions_if_present7   s   
r   N)	playwright.sync_apir   core.artifactsr   core.logr   boolr   r   r   r   r   r   <module>   s
   /