
    +g4                         S SK r S SKJr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr   " S S	\\5      r " S
 S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S\S9r " S S\5      rg)    N)ABCMeta)abstractmethod)Enum)Optional)InvalidArgumentException)Proxyc                   $    \ rS rSrSrSrSrSrSrg)PageLoadStrategy   an  Enum of possible page load strategies.

Selenium support following strategies:
    * normal (default) - waits for all resources to download
    * eager - DOM access is ready, but other resources like images may still be loading
    * none - does not block `WebDriver` at all

Docs: https://www.selenium.dev/documentation/webdriver/drivers/options/#pageloadstrategy.
normaleagernone N)	__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__r       i/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/selenium/webdriver/common/options.pyr
   r
      s     FEDr   r
   c                   &    \ rS rSrS rS rS rSrg)_BaseOptionsDescriptor,   c                     Xl         g Nnameselfr   s     r   __init___BaseOptionsDescriptor.__init__-       	r   c                    U R                   S:X  a6  UR                  R                  S5      nUSL =(       d    [        U[        5      $ U R                   S:X  a>  UR                  R                  U R                   5      n[        U[        5      (       d  S $ U$ U R                   S;   a&  UR                  R                  U R                   S5      $ UR                  R                  U R                   5      $ )N
enableBidiwebSocketUrlT)acceptInsecureCertsstrictFileInteractabilitysetWindowRectse:downloadsEnabledF)r   _capsget
isinstancestr)r    objclsvalues       r   __get___BaseOptionsDescriptor.__get__0   s    99$IIMM.1ED=:Juc$::99&IIMM$)),E)%554@5@99tt99==E22yy}}TYY''r   c                     U R                   S:X  a  UR                  SU5        g UR                  U R                   U5        g )Nr%   r&   )r   set_capabilityr    r/   r1   s      r   __set___BaseOptionsDescriptor.__set__=   s2    99$~u5tyy%0r   r   N)r   r   r   r   r!   r2   r7   r   r   r   r   r   r   ,   s    (1r   r   c                   *    \ rS rSrSrS rS rS rSrg)_PageLoadStrategyDescriptorD   zDetermines the point at which a navigation command is returned:
https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.

:param strategy: the strategy corresponding to a document readiness state
c                     Xl         g r   r   r   s     r   r!   $_PageLoadStrategyDescriptor.__init__K   r#   r   c                 L    UR                   R                  U R                  5      $ r   r+   r,   r   r    r/   r0   s      r   r2   #_PageLoadStrategyDescriptor.__get__N       yy}}TYY''r   c                 ^    US;   a  UR                  U R                  U5        g [        S5      e)N)r   r   r   z>Strategy can only be one of the following: normal, eager, noner5   r   
ValueErrorr6   s      r   r7   #_PageLoadStrategyDescriptor.__set__Q   s+    //tyy%0]^^r   r   N	r   r   r   r   r   r!   r2   r7   r   r   r   r   r:   r:   D   s    (_r   r:   c                   *    \ rS rSrSrS rS rS rSrg)"_UnHandledPromptBehaviorDescriptorX   aP  How the driver should respond when an alert is present and the:
command sent is not handling the alert:
https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:

:param behavior: behavior to use when an alert is encountered

:returns: Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)
c                     Xl         g r   r   r   s     r   r!   +_UnHandledPromptBehaviorDescriptor.__init__b   r#   r   c                 L    UR                   R                  U R                  5      $ r   r?   r@   s      r   r2   *_UnHandledPromptBehaviorDescriptor.__get__e   rB   r   c                 ^    US;   a  UR                  U R                  U5        g [        S5      e)N)dismissacceptzdismiss and notifyzaccept and notifyignoreziBehavior can only be one of the following: dismiss, accept, dismiss and notify, accept and notify, ignorerD   r6   s      r   r7   *_UnHandledPromptBehaviorDescriptor.__set__h   s1    ^^tyy%0, r   r   NrG   r   r   r   rI   rI   X   s    (r   rI   c                   *    \ rS rSrSrS rS rS rSrg)_TimeoutsDescriptorr   a<  How long the driver should wait for actions to complete before:
returning an error https://w3c.github.io/webdriver/#timeouts:

:param timeouts: values in milliseconds for implicit wait, page load and script timeout

:returns: Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)
c                     Xl         g r   r   r   s     r   r!   _TimeoutsDescriptor.__init__{   r#   r   c                 L    UR                   R                  U R                  5      $ r   r?   r@   s      r   r2   _TimeoutsDescriptor.__get__~   rB   r   c                     [        S UR                  5        5       5      (       a  UR                  U R                  U5        g [	        S5      e)Nc              3   *   #    U  H	  oS ;   v   M     g7f))implicitpageLoadscriptNr   ).0xs     r   	<genexpr>._TimeoutsDescriptor.__set__.<locals>.<genexpr>   s     M166s   zITimeout keys can only be one of the following: implicit, pageLoad, script)allkeysr5   r   rE   r6   s      r   r7   _TimeoutsDescriptor.__set__   s9    M

MMMtyy%0hiir   r   NrG   r   r   r   rU   rU   r   s    (jr   rU   c                   *    \ rS rSrSrS rS rS rSrg)_ProxyDescriptor   z':Returns: Proxy if set, otherwise None.c                     Xl         g r   r   r   s     r   r!   _ProxyDescriptor.__init__   r#   r   c                     UR                   $ r   )_proxyr@   s      r   r2   _ProxyDescriptor.__get__   s    zzr   c                     [        U[        5      (       d  [        S5      eX!l        UR	                  5       UR
                  U R                  '   g )Nz$Only Proxy objects can be passed in.)r-   r   r   rm   to_capabilitiesr+   r   r6   s      r   r7   _ProxyDescriptor.__set__   s;    %''*+QRR
$446		$))r   r   NrG   r   r   r   rh   rh      s    17r   rh   c            	         ^  \ rS rSrSr\" S5      r \" S5      r \" S5      r \" S5      r	 \" S5      r
 \" S5      r \" S	5      r \" S
5      r \" S5      r \" S5      r \" S5      r \" S5      r \" S	5      r SU 4S jjr\S 5       rSS jr   SS\\   S\\   S\\   SS4S jjr\S 5       r\\S 5       5       rSS jr Sr!U =r"$ )BaseOptions   z*Base class for individual browser options.browserVersionplatformNamer'   r(   r)   r%   r&   pageLoadStrategyunhandledPromptBehaviortimeoutsproxyr*   returnNc                    > [         TU ]  5         U R                  U l        S U l        U R                  S[        R                  5        S U l        SU l	        g )Nrw   F)
superr!   default_capabilitiesr+   rm   r5   r
   r   mobile_options_ignore_local_proxyr    	__class__s    r   r!   BaseOptions.__init__  sJ    ..
.0@0G0GH"#( r   c                     U R                   $ r   r+   r    s    r   capabilitiesBaseOptions.capabilities  s    zzr   c                      X R                   U'   g)zSets a capability.Nr   )r    r   r1   s      r   r5   BaseOptions.set_capability  s     

4r   android_packageandroid_activitydevice_serialc                     U(       d  [        S5      eSU0U l        U(       a  X R                  S'   U(       a  X0R                  S'   gg)zEnables mobile browser use for browsers that support it.

:Args:
    android_activity: The name of the android package to start
z!android_package must be passed inandroidPackageandroidActivityandroidDeviceSerialN)AttributeErrorr   )r    r   r   r   s       r   enable_mobileBaseOptions.enable_mobile  sI      !DEE/A5E 129F 56 r   c                     g)z-Convert options into capabilities dictionary.Nr   r   s    r   rp   BaseOptions.to_capabilities      r   c                     g)z6Return minimal capabilities necessary as a dictionary.Nr   r   s    r   r~    BaseOptions.default_capabilities  r   r   c                     SU l         g)YBy calling this you will ignore HTTP_PROXY and HTTPS_PROXY from
being picked up and used.TN)r   r   s    r   (ignore_local_proxy_environment_variables4BaseOptions.ignore_local_proxy_environment_variables  s     $( r   )r+   r   rm   r   r{   N)NNN)#r   r   r   r   r   r   browser_versionplatform_nameaccept_insecure_certsstrict_file_interactabilityset_window_rectenable_bidiweb_socket_urlr:   page_load_strategyrI   unhandled_prompt_behaviorrU   ry   rh   rz   enable_downloadsr!   propertyr   r5   r   r.   r   r   rp   r~   r   r   __classcell__r   s   @r   rs   rs      s   4,-=>O* +>:M* 33HI* #99T"U* -_=O* )6K* ,N;N* 55GH* !CC\ ], #:.H, W%E* ..CD* ,N;N*)  ! *.*.'+	G!#G #3-G  }	G
 
G& < < E  E( (r   rs   )	metaclassc                   t   ^  \ rS rSrSrSrSU 4S jjr\S 5       rSS jr	SU 4S jjr
S r\S	 5       rS
rU =r$ )
ArgOptionsi  z Binary Location Must be a Stringzfedcm:accountsc                 0   > [         TU ]  5         / U l        g r   )r}   r!   
_argumentsr   s    r   r!   ArgOptions.__init__  s    r   c                     U R                   $ )z5:Returns: A list of arguments needed for the browser.r   r   s    r   	argumentsArgOptions.arguments  s     r   c                 ^    U(       a  U R                   R                  U5        g[        S5      e)z<Adds an argument to the list.

:Args:
 - Sets the arguments
zargument can not be nullN)r   appendrE   )r    arguments     r   add_argumentArgOptions.add_argument  s%     OO""8,788r   c                 V   > [         R                  " S[        SS9  [        TU ]  5         g)r   a  using ignore_local_proxy_environment_variables in Options has been deprecated, instead, create a Proxy instance with ProxyType.DIRECT to ignore proxy settings, pass the proxy instance into a ClientConfig constructor, pass the client config instance into the Webdriver constructor   )
stacklevelN)warningswarnDeprecationWarningr}   r   r   s    r   r   3ArgOptions.ignore_local_proxy_environment_variables  s,     	M 	
 	8:r   c                     U R                   $ r   r   r   s    r   rp   ArgOptions.to_capabilities  s    zzr   c                     0 $ r   r   r   s    r   r~   ArgOptions.default_capabilities  s    	r   r   r   )r   r   r   r   BINARY_LOCATION_ERRORFEDCM_CAPABILITYr!   r   r   r   r   rp   r~   r   r   r   s   @r   r   r     sK    >'  	9;  r   r   )r   abcr   r   enumr   typingr   selenium.common.exceptionsr   selenium.webdriver.common.proxyr   r.   r
   r   r:   rI   rU   rh   rs   r   r   r   r   <module>r      s{   $      ? 1sD  1 10_ _( 4j j,7 7 R(G R(j
, ,r   