B
     ¸hE)  ã               @   s0   d dl mZ G dd„ deƒZG dd„ deƒZdS )é    )ÚDesiredCapabilitiesc               @   s   e Zd ZdZdZdS )ÚElementScrollBehaviorr   é   N)Ú__name__Ú
__module__Ú__qualname__ÚTOPÚBOTTOM© r
   r
   úZC:\Users\sanjo\AppData\Local\Qlobot\Launcher\ext_packages\selenium\webdriver\ie\options.pyr      s   r   c               @   s.  e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdd„ Zedd„ ƒZdd„ Zedd„ ƒZedd„ ƒZdd„ Zedd„ ƒZejd d„ ƒZed!d"„ ƒZejd#d"„ ƒZed$d%„ ƒZejd&d%„ ƒZed'd(„ ƒZejd)d(„ ƒZed*d+„ ƒZ e jd,d+„ ƒZ ed-d.„ ƒZ!e!jd/d.„ ƒZ!ed0d1„ ƒZ"e"jd2d1„ ƒZ"ed3d4„ ƒZ#e#jd5d4„ ƒZ#ed6d7„ ƒZ$e$jd8d7„ ƒZ$ed9d:„ ƒZ%e%jd;d:„ ƒZ%ed<d=„ ƒZ&e&jd>d=„ ƒZ&ed?d@„ ƒZ'e'jdAd@„ ƒZ'edBdC„ ƒZ(e(jdDdC„ ƒZ(edEdF„ ƒZ)e)jdGdF„ ƒZ)edHdI„ ƒZ*e*jdJdI„ ƒZ*edKdL„ ƒZ+dMdN„ Z,dOdP„ Z-dQS )RÚOptionszse:ieOptionszie.browserCommandLineSwitchesZbrowserAttachTimeoutZelementScrollBehaviorzie.ensureCleanSessionzie.fileUploadDialogTimeoutzie.forceCreateProcessApizie.forceShellWindowsApizie.enableFullPageScreenshotZignoreProtectedModeSettingsZignoreZoomSettingZinitialBrowserUrlZnativeEventsZenablePersistentHoverZrequireWindowFocuszie.usePerProcessProxyzie.validateCookieDocumentTypec             C   s"   g | _ i | _i | _tj ¡ | _d S )N)Ú
_argumentsÚ_optionsÚ_additionalr   ÚINTERNETEXPLORERÚcopyÚ_caps)Úselfr
   r
   r   Ú__init__.   s    zOptions.__init__c             C   s   | j S )z- Returns a list of browser process arguments )r   )r   r
   r
   r   Ú	arguments4   s    zOptions.argumentsc             C   s   |dkrt ƒ ‚| j |¡ dS )z1 Add argument to be used for the browser process N)Ú
ValueErrorr   Úappend)r   Úargumentr
   r
   r   Úadd_argument9   s    zOptions.add_argumentc             C   s   | j S )z) Returns a dictionary of browser options )r   )r   r
   r
   r   Úoptions?   s    zOptions.optionsc             C   s   | j S )N)r   )r   r
   r
   r   ÚcapabilitiesD   s    zOptions.capabilitiesc             C   s   || j |< dS )zSets a capability.N)r   )r   ÚnameÚvaluer
   r
   r   Úset_capabilityH   s    zOptions.set_capabilityc             C   s   | j  | j¡S )z< Returns the options Browser Attach Timeout in milliseconds )r   ÚgetÚBROWSER_ATTACH_TIMEOUT)r   r
   r
   r   Úbrowser_attach_timeoutL   s    zOptions.browser_attach_timeoutc             C   s"   t |tƒstdƒ‚|| j| j< dS )zt
        Sets the options Browser Attach Timeout

        :Args:
         - value: Timeout in milliseconds

        z*Browser Attach Timeout must be an integer.N)Ú
isinstanceÚintr   r   r    )r   r   r
   r
   r   r!   Q   s    	
c             C   s   | j  | j¡S )z= Returns the options Element Scroll Behavior in milliseconds )r   r   ÚELEMENT_SCROLL_BEHAVIOR)r   r
   r
   r   Úelement_scroll_behavior^   s    zOptions.element_scroll_behaviorc             C   s(   |t jt jgkrtdƒ‚|| j| j< dS )zq
        Sets the options Element Scroll Behavior

        :Args:
         - value: 0 - Top, 1 - Bottom

        z%Element Scroll Behavior out of range.N)r   r   r	   r   r   r$   )r   r   r
   r
   r   r%   c   s    	c             C   s   | j  | j¡S )z0 Returns the options Ensure Clean Session value )r   r   ÚENSURE_CLEAN_SESSION)r   r
   r
   r   Úensure_clean_sessionp   s    zOptions.ensure_clean_sessionc             C   s   || j | j< dS )zn
        Sets the options Ensure Clean Session value

        :Args:
         - value: boolean value

        N)r   r&   )r   r   r
   r
   r   r'   u   s    	c             C   s   | j  | j¡S )z@ Returns the options File Upload Dialog Timeout in milliseconds )r   r   ÚFILE_UPLOAD_DIALOG_TIMEOUT)r   r
   r
   r   Úfile_upload_dialog_timeout€   s    z"Options.file_upload_dialog_timeoutc             C   s"   t |tƒstdƒ‚|| j| j< dS )z~
        Sets the options File Upload Dialog Timeout value

        :Args:
         - value: Timeout in milliseconds

        z.File Upload Dialog Timeout must be an integer.N)r"   r#   r   r   r(   )r   r   r
   r
   r   r)   …   s    	
c             C   s   | j  | j¡S )z4 Returns the options Force Create Process Api value )r   r   ÚFORCE_CREATE_PROCESS_API)r   r
   r
   r   Úforce_create_process_api’   s    z Options.force_create_process_apic             C   s   || j | j< dS )zr
        Sets the options Force Create Process Api value

        :Args:
         - value: boolean value

        N)r   r*   )r   r   r
   r
   r   r+   —   s    	c             C   s   | j  | j¡S )z3 Returns the options Force Shell Windows Api value )r   r   ÚFORCE_SHELL_WINDOWS_API)r   r
   r
   r   Úforce_shell_windows_api¢   s    zOptions.force_shell_windows_apic             C   s   || j | j< dS )zq
        Sets the options Force Shell Windows Api value

        :Args:
         - value: boolean value

        N)r   r,   )r   r   r
   r
   r   r-   §   s    	c             C   s   | j  | j¡S )z0 Returns the options Full Page Screenshot value )r   r   ÚFULL_PAGE_SCREENSHOT)r   r
   r
   r   Úfull_page_screenshot²   s    zOptions.full_page_screenshotc             C   s   || j | j< dS )zn
        Sets the options Full Page Screenshot value

        :Args:
         - value: boolean value

        N)r   r.   )r   r   r
   r
   r   r/   ·   s    	c             C   s   | j  | j¡S )z: Returns the options Ignore Protected Mode Settings value )r   r   ÚIGNORE_PROTECTED_MODE_SETTINGS)r   r
   r
   r   Úignore_protected_mode_settingsÂ   s    z&Options.ignore_protected_mode_settingsc             C   s   || j | j< dS )zx
        Sets the options Ignore Protected Mode Settings value

        :Args:
         - value: boolean value

        N)r   r0   )r   r   r
   r
   r   r1   Ç   s    	c             C   s   | j  | j¡S )z- Returns the options Ignore Zoom Level value )r   r   ÚIGNORE_ZOOM_LEVEL)r   r
   r
   r   Úignore_zoom_levelÒ   s    zOptions.ignore_zoom_levelc             C   s   || j | j< dS )zk
        Sets the options Ignore Zoom Level value

        :Args:
         - value: boolean value

        N)r   r2   )r   r   r
   r
   r   r3   ×   s    	c             C   s   | j  | j¡S )z/ Returns the options Initial Browser Url value )r   r   ÚINITIAL_BROWSER_URL)r   r
   r
   r   Úinitial_browser_urlâ   s    zOptions.initial_browser_urlc             C   s   || j | j< dS )zj
        Sets the options Initial Browser Url value

        :Args:
         - value: URL string

        N)r   r4   )r   r   r
   r
   r   r5   ç   s    	c             C   s   | j  | j¡S )z) Returns the options Native Events value )r   r   ÚNATIVE_EVENTS)r   r
   r
   r   Únative_eventsò   s    zOptions.native_eventsc             C   s   || j | j< dS )zg
        Sets the options Native Events value

        :Args:
         - value: boolean value

        N)r   r6   )r   r   r
   r
   r   r7   ÷   s    	c             C   s   | j  | j¡S )z, Returns the options Persistent Hover value )r   r   ÚPERSISTENT_HOVER)r   r
   r
   r   Úpersistent_hover  s    zOptions.persistent_hoverc             C   s   || j | j< dS )zj
        Sets the options Persistent Hover value

        :Args:
         - value: boolean value

        N)r   r8   )r   r   r
   r
   r   r9     s    	c             C   s   | j  | j¡S )z0 Returns the options Require Window Focus value )r   r   ÚREQUIRE_WINDOW_FOCUS)r   r
   r
   r   Úrequire_window_focus  s    zOptions.require_window_focusc             C   s   || j | j< dS )zn
        Sets the options Require Window Focus value

        :Args:
         - value: boolean value

        N)r   r:   )r   r   r
   r
   r   r;     s    	c             C   s   | j  | j¡S )z2 Returns the options User Per Process Proxy value )r   r   ÚUSE_PER_PROCESS_PROXY)r   r
   r
   r   Úuse_per_process_proxy"  s    zOptions.use_per_process_proxyc             C   s   || j | j< dS )zp
        Sets the options User Per Process Proxy value

        :Args:
         - value: boolean value

        N)r   r<   )r   r   r
   r
   r   r=   '  s    	c             C   s   | j  | j¡S )z9 Returns the options Validate Cookie Document Type value )r   r   ÚVALIDATE_COOKIE_DOCUMENT_TYPE)r   r
   r
   r   Úvalidate_cookie_document_type2  s    z%Options.validate_cookie_document_typec             C   s   || j | j< dS )zw
        Sets the options Validate Cookie Document Type value

        :Args:
         - value: boolean value

        N)r   r>   )r   r   r
   r
   r   r?   7  s    	c             C   s   | j S )z  Returns the additional options )r   )r   r
   r
   r   Úadditional_optionsB  s    zOptions.additional_optionsc             C   s   || j |< dS )zº
        Adds an additional option not yet added as a safe option for IE

        :Args:
         - name: name of the option to add
         - value: value of the option to add

        N)r   )r   r   r   r
   r
   r   Úadd_additional_optionG  s    	zOptions.add_additional_optionc             C   sd   | j }| j ¡ }t| jƒdkr0d | j¡|| j< t| jƒdkrJ| | j¡ t|ƒdkr`||t	j
< |S )z1 Marshals the IE options to a the correct object r   ú )r   r   r   Úlenr   ÚjoinÚSWITCHESr   Úupdater   ÚKEY)r   ÚcapsÚoptsr
   r
   r   Úto_capabilitiesR  s    

zOptions.to_capabilitiesN).r   r   r   rG   rE   r    r$   r&   r(   r*   r,   r.   r0   r2   r4   r6   r8   r:   r<   r>   r   Úpropertyr   r   r   r   r   r!   Úsetterr%   r'   r)   r+   r-   r/   r1   r3   r5   r7   r9   r;   r=   r?   r@   rA   rJ   r
   r
   r
   r   r      sp   r   N)Ú.selenium.webdriver.common.desired_capabilitiesr   Úobjectr   r   r
   r
   r
   r   Ú<module>   s   