a
    Šxd¼  ã                   @   sB   d dl Z d dlmZ d dlmZ G dd„ dƒZG dd„ deƒZdS )é    N)ÚDesiredCapabilities)Ú
ArgOptionsc                   @   s(   e Zd Zddœdd„Zedœdd„ZdS )ÚLogN©Úreturnc                 C   s
   d | _ d S ©N©Úlevel©Úself© r   úY/var/www/html/Ranjet/env/lib/python3.9/site-packages/selenium/webdriver/safari/options.pyÚ__init__   s    zLog.__init__c                 C   s   | j rdd| j iiS i S )NÚlogr	   r   r
   r   r   r   Úto_capabilities   s    zLog.to_capabilities)Ú__name__Ú
__module__Ú__qualname__r   Údictr   r   r   r   r   r      s   r   c                       sü   e Zd ZdZdZdZdZddœ‡ fdd„Zee	dœd	d
„ƒZ
e
je	ddœdd
„ƒZ
edœdd„Zeeje	e	f dœdd„ƒZeedœdd„ƒZejeddœdd„ƒZeedœdd„ƒZejeddœdd„ƒZeedœdd„ƒZejeddœdd„ƒZ‡  ZS )ÚOptionszsafari.optionszsafari:automaticInspectionzsafari:automaticProfilingzSafari Technology PreviewNr   c                    s"   t ƒ  ¡  d | _i | _tƒ | _d S r   )Úsuperr   Ú_binary_locationZ_preferencesr   r   r
   ©Ú	__class__r   r   r   *   s    
zOptions.__init__c                 C   s   | j S )zX
        :Returns: The location of the browser binary otherwise an empty string
        ©r   r
   r   r   r   Úbinary_location0   s    zOptions.binary_location)Úvaluer   c                 C   s
   || _ dS )zvAllows you to set the browser binary to launch.

        :Args:
         - value : path to the browser binary
        Nr   ©r   r   r   r   r   r   7   s    c                 C   sL   | j }i }| jr| j|d< | jr*| j|d< | | j ¡ ¡ |rH||tj< |S )z8Marshals the  options to an desired capabilities object.ÚargsÚbinary)Ú_capsZ
_argumentsr   Úupdater   r   r   ÚKEY)r   ZcapsÚoptsr   r   r   r   @   s    


zOptions.to_capabilitiesc                 C   s
   t j ¡ S r   )r   ZSAFARIÚcopyr
   r   r   r   Údefault_capabilitiesT   s    zOptions.default_capabilitiesc                 C   s   | j  | j¡S )z/:Returns: The option Automatic Inspection value)r    ÚgetÚAUTOMATIC_INSPECTIONr
   r   r   r   Úautomatic_inspectionX   s    zOptions.automatic_inspectionc                 C   s   |   | j|¡ dS )zgSets the option Automatic Inspection to value.

        :Args:
         - value: boolean value
        N)Úset_capabilityr'   r   r   r   r   r(   ]   s    c                 C   s   | j  | j¡S )z/:Returns: The options Automatic Profiling value)r    r&   ÚAUTOMATIC_PROFILINGr
   r   r   r   Úautomatic_profilingf   s    zOptions.automatic_profilingc                 C   s   |   | j|¡ dS )zfSets the option Automatic Profiling to value.

        :Args:
         - value: boolean value
        N)r)   r*   r   r   r   r   r+   k   s    c                 C   s   | j  d¡| jkS )zD:Returns: whether BROWSER_NAME is equal to Safari Technology PreviewÚbrowserName)r    r&   ÚSAFARI_TECH_PREVIEWr
   r   r   r   Úuse_technology_previewt   s    zOptions.use_technology_previewc                 C   s   |   d|r| jnd¡ dS )zˆSets browser name to Safari Technology Preview if value else to
        safari.

        :Args:
         - value: boolean value
        r,   ZsafariN)r)   r-   r   r   r   r   r.   y   s    )r   r   r   r"   r'   r*   r-   r   ÚpropertyÚstrr   Úsetterr   r   ÚtypingÚDictr%   Úboolr(   r+   r.   Ú__classcell__r   r   r   r   r   !   s0   r   )r2   Z.selenium.webdriver.common.desired_capabilitiesr   Z!selenium.webdriver.common.optionsr   r   r   r   r   r   r   Ú<module>   s   
