
    Y j1                         S SK r S SKJr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)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       r/root/GenerationalWealth/GenerationalWealth/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__.   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.   r0   s      r   __set___BaseOptionsDescriptor.__set__;   s2    99$~u5tyy%0r   r   N)r   r   r   r   r    r1   r6   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)_PageLoadStrategyDescriptorB   zDetermines the point at which a navigation command is returned.

See:
  - https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.

Args:
    strategy: the strategy corresponding to a document readiness state
c                     Xl         g r   r   r   s     r   r    $_PageLoadStrategyDescriptor.__init__L   r"   r   c                 L    UR                   R                  U R                  5      $ r   r*   r+   r   r   r.   r/   s      r   r1   #_PageLoadStrategyDescriptor.__get__O       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r4   r   
ValueErrorr5   s      r   r6   #_PageLoadStrategyDescriptor.__set__R   s+    //tyy%0]^^r   r   N	r   r   r   r   r   r    r1   r6   r   r   r   r   r9   r9   B   s    (_r   r9   c                   *    \ rS rSrSrS rS rS rSrg)"_UnHandledPromptBehaviorDescriptorY   a_  How the driver should respond when an alert is present and the command sent is not handling the alert.

See:
  - https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:

Args:
    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__f   r"   r   c                 L    UR                   R                  U R                  5      $ r   r>   r?   s      r   r1   *_UnHandledPromptBehaviorDescriptor.__get__i   rA   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, ignorerC   r5   s      r   r6   *_UnHandledPromptBehaviorDescriptor.__set__l   s1    ^^tyy%0, r   r   NrF   r   r   r   rH   rH   Y   s    
(r   rH   c                   *    \ rS rSrSrS rS rS rSrg)_TimeoutsDescriptorv   aK  How long the driver should wait for actions to complete before returning an error.

See:
  - https://w3c.github.io/webdriver/#timeouts

Args:
    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   r1   _TimeoutsDescriptor.__get__   rA   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keysr4   r   rD   r5   s      r   r6   _TimeoutsDescriptor.__set__   s9    M

MMMtyy%0hiir   r   NrF   r   r   r   rT   rT   v   s    
(jr   rT   c                   *    \ rS rSrSrS rS rS rSrg)_ProxyDescriptor   zRDescriptor for proxy property access.

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   r1   _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   rl   to_capabilitiesr*   r   r5   s      r   r6   _ProxyDescriptor.__set__   s;    %''*+QRR
$446		$))r   r   NrF   r   r   r   rg   rg      s    7r   rg   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U 4S jjr\S 5       rSS jr   SS\S-  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$   pageLoadStrategyunhandledPromptBehaviortimeoutsproxyr)   r%   returnNc                    > [         TU ]  5         U R                  U l        S U l        U R                  S[        R                  5        S U l        SU l	        g )Nrv   F)
superr    default_capabilitiesr*   rl   r4   r	   r   mobile_options_ignore_local_proxyr   	__class__s    r   r    BaseOptions.__init__O  sJ    ..
.0@0G0GH59#( r   c                     U R                   $ r   r*   r   s    r   capabilitiesBaseOptions.capabilitiesW  s    zzr   c                      X R                   U'   g)zSets a capability.Nr   )r   r   r0   s      r   r4   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_package: The name of the android package to start
    android_activity: The name of the android activity
    device_serial: The device serial number
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   ro   BaseOptions.to_capabilitiest      r   c                     g)z6Return minimal capabilities necessary as a dictionary.Nr   r   s    r   r}    BaseOptions.default_capabilitiesx  r   r   c                     SU l         g)z8Ignore HTTP_PROXY and HTTPS_PROXY environment variables.TN)r   r   s    r   (ignore_local_proxy_environment_variables4BaseOptions.ignore_local_proxy_environment_variables}  s
    #' r   )r*   r   rl   r~   rz   N)NNN)"r   r   r   r   r   r   browser_versionplatform_nameaccept_insecure_certsstrict_file_interactabilityset_window_rectenable_bidir9   page_load_strategyrH   unhandled_prompt_behaviorrT   rx   rg   ry   enable_downloadsweb_socket_urlr    propertyr   r4   r-   r   r   ro   r}   r   r   __classcell__r   s   @r   rr   rr      s}   4,-=>O +>:M 33HI #99T"U -_=O )6K 55GH !CC\ ] #:.H W%E ..CD ,N;N)  ! '+'+$(	GtG *G Tz	G
 
G* < < E  E( (r   rr   )	metaclassc                   |   ^  \ rS rSrSrSrSU 4S jjr\S 5       rS\	SS4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:accountsrz   Nc                 0   > [         TU ]  5         / U l        g r   )r|   r    
_argumentsr   s    r   r    ArgOptions.__init__  s    %'r   c                     U R                   $ )z3Returns a list of arguments needed for the browser.r   r   s    r   	argumentsArgOptions.arguments  s     r   argumentc                 ^    U(       a  U R                   R                  U5        g[        S5      e)zFAdds an argument to the list.

Args:
    argument: Sets the arguments
zargument can not be nullN)r   appendrD   )r   r   s     r   add_argumentArgOptions.add_argument  s%     OO""8,788r   c                 V   > [         R                  " S[        SS9  [        TU ]  5         g)zIgnore HTTP_PROXY and HTTPS_PROXY environment variables.

This method is deprecated; use a Proxy instance with ProxyType.DIRECT instead.
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   ro   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   r   ro   r}   r   r   r   s   @r   r   r     sY    >'(  	9S 	9T 	9;   r   r   )r   abcr   r   enumr   selenium.common.exceptionsr   selenium.webdriver.common.proxyr   r-   r	   r   r9   rH   rT   rg   rr   r   r   r   r   <module>r      su   $  '  ? 1sD  1 10_ _. :j j47 7([(G [(|. .r   