o
    !i@                     @  s6   d Z ddlmZ ddlmZ ddlmZ dd
dZdS )z'Home navigation helpers for OfficeSite.    )annotations)Page   )
officesitepager   returnNonec              	   C  s   zc|  d|  d| jddd| jddd|  d|  dg}|D ]@}z5| d	kr,W q!t|d
r4|jn|}z|jdd W n	 tyG   Y nw |jddd | d W  W dS  tya   Y q!w W n	 tyl   Y nw t	j
| dd dS )zx
    Ensure we're on OfficeSite Home by clicking the Home menu if present.
    Falls back to direct OfficeSite URL.
    z[data-aroflo-menuitem='Home']z.menuBtn.type-homelinkHome)namebuttonza:has-text('Home')zbutton:has-text('Home')r   firsti  )timeouti  T)r   forcei^  N)r   )locatorget_by_rolecounthasattrr   hover	Exceptionclickwait_for_timeoutofficesite_selensure_officesite)r   
candidatesloctarget r   b/var/www/html/flask_server/apps/aroflo_connector_app/ui_automation_zones/common/officesite/home.pyensure_home	   s:   

r   N)r   r   r   r   )	__doc__
__future__r   playwright.sync_apir   	selectorsr   r   r   r   r   r   r   <module>   s
    