o
    B_iL                     @  sZ   d dl mZ d dlmZ ddlmZ ddlmZmZ ddl	m
Z
 ddlmZ dd
dZdS )    )annotations)sync_playwright   )launch_browser_context)create_run_dirshot)ensure_logged_in)timesheet_navreturnintc                 C  st  | j  std| j  dt| d}t }t|| t| j d\}}| }zVz!t|| |ddd t	
|| | t||d |jt| j d	 W n ty\ } zt||d
  d}~ww W z|  W n	 tym   Y nw z|  W n) ty}   Y n!w z|  W n	 ty   Y nw z|  W w  ty   Y w w W d   n1 sw   Y  td td|  dS )uV   
    Usa storageState (como smoke), valida sesión, y ejecuta flow timesheet_nav.
    zstorageState not found: z. Run bootstrap first.ztimesheet-nav)storage_state F)mfa_code	allow_mfaok)pathz99-errorNz[UI] timesheet-nav OKz[UI] Artifacts: r   )
state_fileexists
SystemExitr   r   r   strnew_pager   timesheet_nav_flowrunr   r   	Exceptioncloseprint)cfgrun_dirpbrowsercontextpagee r#   \/var/www/html/flask_server/apps/aroflo_connector_app/ui_automation/commands/timesheet_nav.pycmd_timesheet_nav   sT   

r%   N)r
   r   )
__future__r   playwright.sync_apir   core.browserr   core.artifactsr   r   auth.sessionr   flowsr	   r   r%   r#   r#   r#   r$   <module>   s   