zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
U
\±dã@snUddlZddlZddlmZddlmZddlmZdZee    d<efZ
ej ej e e    d<Gdd    „d    ƒZdS)
éN)ÚNoSuchElementException)ÚTimeoutException)Ú WaitExcTypesgà?ÚPOLL_FREQUENCYÚIGNORED_EXCEPTIONSc@sReZdZedfeeejedœdd„Zdd„Z    d e
dœd    d
„Z de
dœd d „Z dS)Ú WebDriverWaitN)ÚtimeoutÚpoll_frequencyÚignored_exceptionscCsr||_t|ƒ|_||_|jdkr&t|_ttƒ}|rdz| t|ƒ¡Wnt    k
rb| 
|¡YnXt |ƒ|_ dS)aFConstructor, takes a WebDriver instance and timeout in seconds.
 
        :Args:
         - driver - Instance of WebDriver (Ie, Firefox, Chrome or Remote)
         - timeout - Number of seconds before timing out
         - poll_frequency - sleep interval between calls
           By default, it is 0.5 second.
         - ignored_exceptions - iterable structure of exception classes ignored during calls.
           By default, it contains NoSuchElementException only.
 
        Example::
 
         from selenium.webdriver.support.wait import WebDriverWait 
 
         element = WebDriverWait(driver, 10).until(lambda x: x.find_element(By.ID, "someId")) 
 
         is_disappeared = WebDriverWait(driver, 30, 1, (ElementNotVisibleException)).\ 
 
                     until_not(lambda x: x.find_element(By.ID, "someId").is_displayed())
        rN) Ú_driverÚfloatÚ_timeoutÚ_pollrÚlistrÚextendÚiterÚ    TypeErrorÚappendÚtupleÚ_ignored_exceptions)ÚselfZdriverrr    r
Ú
exceptions©rúVd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/support/wait.pyÚ__init__s
 
zWebDriverWait.__init__cCs(dt|ƒj›dt|ƒj›d|jj›dS)Nú<Ú.z  (session="z")>)ÚtypeÚ
__module__Ú__name__r Z
session_id)rrrrÚ__repr__DszWebDriverWait.__repr__Ú)Úmessagec
Cs˜d}d}t ¡|j}z||jƒ}|r,|WSWn<|jk
rj}zt|ddƒ}t|ddƒ}W5d}~XYnXt |j¡t ¡|krqˆqt|||ƒ‚dS)aCalls the method provided with the driver as an argument until the         return value does not evaluate to ``False``.
 
        :param method: callable(WebDriver)
        :param message: optional message for :exc:`TimeoutException`
        :returns: the result of the last call to `method`
        :raises: :exc:`selenium.common.exceptions.TimeoutException` if timeout occurs
        NÚscreenÚ
stacktrace)    ÚtimeÚ    monotonicr r rÚgetattrÚsleeprr)rÚmethodr"r#r$Úend_timeÚvalueÚexcrrrÚuntilGs    
 
   zWebDriverWait.untilcCsht ¡|j}z||jƒ}|s$|WSWn|jk
r>YdSXt |j¡t ¡|krq\qt|ƒ‚dS)aÍCalls the method provided with the driver as an argument until the         return value evaluates to ``False``.
 
        :param method: callable(WebDriver)
        :param message: optional message for :exc:`TimeoutException`
        :returns: the result of the last call to `method`, or
                  ``True`` if `method` has raised one of the ignored exceptions
        :raises: :exc:`selenium.common.exceptions.TimeoutException` if timeout occurs
        TN)r%r&r r rr(rr)rr)r"r*r+rrrÚ    until_notas
 
 
  zWebDriverWait.until_not)r!)r!) rrÚ __qualname__rr ÚtypingÚOptionalrrr Ústrr-r.rrrrrsûû &r)r%r0Zselenium.common.exceptionsrrZselenium.typesrrr Ú__annotations__rÚTupleÚTypeÚ    ExceptionrrrrrÚ<module>s