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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
U
\±dÜ9ã@szddlZddlmZddlmZddlmZddlmZddlmZddlmZe    dœd    d
„Z
e    dœd d „Z d d„Z e    dœdd„Z e    dœdd„Ze    dœdd„Ze    dœdd„Zdd„Zdd„ZdLdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Z d:d;„Z!d<d=„Z"d>d?„Z#d@dA„Z$dBdC„Z%dDdE„Z&dFdG„Z'dHdI„Z(dJdK„Z)dS)MéN)ÚNoAlertPresentException)ÚNoSuchElementException)ÚNoSuchFrameException)ÚStaleElementReferenceException©ÚWebDriverException)Ú
WebElement©Útitlecs‡fdd„}|S)z¬An expectation for checking the title of a page.
 
    title is the expected title, which must be an exact match returns
    True if the title matches, false otherwise.
    cs
|jˆkS©Nr    ©Údriverr    ©úed:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/support/expected_conditions.pyÚ
_predicate(sztitle_is.<locals>._predicater©r
rrr    rÚtitle_is!s rcs‡fdd„}|S)z¾An expectation for checking that the title contains a case-sensitive
    substring.
 
    title is the fragment of title expected returns True when the title
    matches, False otherwise
    cs
ˆ|jkSr r    r r    rrr6sz"title_contains.<locals>._predicaterrrr    rÚtitle_contains.s rcs‡fdd„}|S)zçAn expectation for checking that an element is present on the DOM of a
    page. This does not necessarily mean that the element is visible.
 
    locator - used to find the element
    returns the WebElement once it is located
    cs
|jˆŽSr )Ú find_elementr ©ÚlocatorrrrDsz/presence_of_element_located.<locals>._predicater©rrrrrÚpresence_of_element_located<s r©Úurlcs‡fdd„}|S)zÀAn expectation for checking that the current url contains a case-
    sensitive substring.
 
    url is the fragment of url expected, returns True when the url
    matches, False otherwise
    cs
ˆ|jkSr ©Ú current_urlr rrrrRsz url_contains.<locals>._predicater©rrrrrÚ url_containsJs r©Úpatterncs‡fdd„}|S)zÐAn expectation for checking the current url.
 
    pattern is the expected pattern.  This finds the first occurrence of
    pattern in the current url and as such does not require an exact
    full match.
    cst ˆ|j¡dk    Sr )ÚreÚsearchrr rrrr`szurl_matches.<locals>._predicater)r rrrrÚ url_matchesXs r#cs‡fdd„}|S)z¢An expectation for checking the current url.
 
    url is the expected url, which must be an exact match returns True
    if the url matches, false otherwise.
    cs
ˆ|jkSr rr rrrrmszurl_to_be.<locals>._predicaterrrrrÚ    url_to_befs r$cs‡fdd„}|S)z«An expectation for checking the current url.
 
    url is the expected url, which must not be an exact match returns
    True if the url is different, false otherwise.
    cs
ˆ|jkSr rr rrrrzszurl_changes.<locals>._predicaterrrrrÚ url_changesss r%cs‡fdd„}|S)a7An expectation for checking that an element is present on the DOM of a
    page and visible. Visibility means that the element is not only displayed
    but also has a height and width that is greater than 0.
 
    locator - used to find the element
    returns the WebElement once it is located and visible
    cs,zt|jˆŽƒWStk
r&YdSXdS©NF)Ú_element_if_visiblerrr rrrr‰sz1visibility_of_element_located.<locals>._predicaterrrrrÚvisibility_of_element_located€s     r(cs‡fdd„}|S)a3An expectation for checking that an element, known to be present on the
    DOM of a page, is visible.
 
    Visibility means that the element is not only displayed but also has
    a height and width that is greater than 0. element is the WebElement
    returns the (same) WebElement once it is visible
    cstˆƒSr ©r'©Ú_©Úelementrrr›sz!visibility_of.<locals>._predicater©r-rrr,rÚ visibility_of’s     r/TcCs| ¡|kr|SdSr&)Z is_displayed)r-Ú
visibilityrrrr'¡sr'cs‡fdd„}|S)zÁAn expectation for checking that there is at least one element present
    on a web page.
 
    locator is used to find the element returns the list of WebElements
    once they are located
    cs
|jˆŽSr ©Ú find_elementsr rrrr­sz4presence_of_all_elements_located.<locals>._predicaterrrrrÚ presence_of_all_elements_located¥s r3cs‡fdd„}|S)zÁAn expectation for checking that there is at least one element visible
    on a web page.
 
    locator is used to find the element returns the list of WebElements
    once they are located
    csdd„|jˆŽDƒS)NcSsg|]}t|ƒr|‘qSrr))Ú.0r-rrrÚ
<listcomp>¼szJvisibility_of_any_elements_located.<locals>._predicate.<locals>.<listcomp>r1r rrrr»sz6visibility_of_any_elements_located.<locals>._predicaterrrrrÚ"visibility_of_any_elements_located³s r6cs‡fdd„}|S)aIAn expectation for checking that all elements are present on the DOM of
    a page and visible. Visibility means that the elements are not only
    displayed but also has a height and width that is greater than 0.
 
    locator - used to find the elements
    returns the list of WebElements once they are located and visible
    csJz.|jˆŽ}|D]}t|ddrWdSq|WStk
rDYdSXdS)NF)r0)r2r'r)r Úelementsr-rrrrÊs
 
z6visibility_of_all_elements_located.<locals>._predicaterrrrrÚ"visibility_of_all_elements_locatedÁs    
r8cs‡‡fdd„}|S)znAn expectation for checking if the given text is present in the
    specified element.
 
    locator, text
    cs2z|jˆŽj}ˆ|kWStk
r,YdSXdSr&)rÚtextr©r Z element_text©rÚtext_rrrÞs
 
z1text_to_be_present_in_element.<locals>._predicater©rr<rrr;rÚtext_to_be_present_in_element×sr>cs‡‡fdd„}|S)zlAn expectation for checking if the given text is present in the
    element's value.
 
    locator, text
    cs6z|jˆŽ d¡}ˆ|kWStk
r0YdSXdS)NÚvalueF©rZ get_attributerr:r;rrrïs
 
z7text_to_be_present_in_element_value.<locals>._predicaterr=rr;rÚ#text_to_be_present_in_element_valueèsrAcs‡‡‡fdd„}|S)z{An expectation for checking if the given text is present in the
    element's attribute.
 
    locator, attribute, text
    csDz(|jˆŽ ˆ¡}|dkr WdSˆ|kWStk
r>YdSXdSr&r@r:©Ú
attribute_rr<rrrs
z;text_to_be_present_in_element_attribute.<locals>._predicater)rrCr<rrrBrÚ'text_to_be_present_in_element_attributeùs    rDcs‡fdd„}|S)z¯An expectation for checking whether the given frame is available to
    switch to.
 
    If the frame is available it switches the given driver to the
    specified frame.
    csVz:tˆdƒr*tˆtƒs*|j |jˆŽ¡n |j ˆ¡WdStk
rPYdSXdS)NÚ__iter__TF)ÚhasattrÚ
isinstanceÚstrÚ    switch_toÚframerrr rrrrs z:frame_to_be_available_and_switch_to_it.<locals>._predicaterrrrrÚ&frame_to_be_available_and_switch_to_it s
rKcs‡fdd„}|S)z‰An Expectation for checking that an element is either invisible or not
    present on the DOM.
 
    locator used to find the element
    c    sDz$ˆ}t|tƒs|j|Ž}t|dƒWSttfk
r>YdSXdS©NFT)rGrrr'rr©r Útargetrrrr(s
 
 z3invisibility_of_element_located.<locals>._predicaterrrrrÚinvisibility_of_element_located!s rOcCst|ƒS)zœAn Expectation for checking that an element is either invisible or not
    present on the DOM.
 
    element is either a locator (text) or an WebElement
    )rOr,rrrÚinvisibility_of_element9srPcs‡fdd„}|S)z›An Expectation for checking an element is visible and enabled such that
    you can click it.
 
    element is either a locator (text) or an WebElement
    cs8ˆ}t|tƒs|j|Ž}t|ƒ|ƒ}|r4| ¡r4|SdSr&)rGrrr/Ú
is_enabledrM©ÚmarkrrrKs
 
  z+element_to_be_clickable.<locals>._predicater)rSrrrRrÚelement_to_be_clickableBs         rTcs‡fdd„}|S)z´Wait until an element is no longer attached to the DOM.
 
    element is the element to wait for. returns False if the element is
    still attached to the DOM, true otherwise.
    cs*zˆ ¡WdStk
r$YdSXdSrL)rQrr*r,rrr^s
z staleness_of.<locals>._predicaterr.rr,rÚ staleness_ofWs rUcs‡fdd„}|S)z]An expectation for checking the selection is selected.
 
    element is WebElement object
    csˆ ¡Sr ©Ú is_selectedr*r,rrrosz*element_to_be_selected.<locals>._predicaterr.rr,rÚelement_to_be_selectedis rXcs‡fdd„}|S)zdAn expectation for the element to be located is selected.
 
    locator is a tuple of (by, path)
    cs|jˆŽ ¡Sr )rrWr rrrr{sz2element_located_to_be_selected.<locals>._predicaterrrrrÚelement_located_to_be_selectedus rYcs‡‡fdd„}|S)z~An expectation for checking if the given element is selected.
 
    element is WebElement object is_selected is a Boolean.
    cs ˆ ¡ˆkSr rVr*©r-rWrrr‡sz1element_selection_state_to_be.<locals>._predicater)r-rWrrrZrÚelement_selection_state_to_besr[cs‡‡fdd„}|S)z¨An expectation to locate an element and check if the selection state
    specified is in that state.
 
    locator is a tuple of (by, path) is_selected is a boolean
    cs4z|jˆŽ}| ¡ˆkWStk
r.YdSXdSr&)rrWr)r r-©rWrrrr”s
 
z9element_located_selection_state_to_be.<locals>._predicater)rrWrrr\rÚ%element_located_selection_state_to_besr]cs‡fdd„}|S)z?An expectation for the number of windows to be a certain value.cst|jƒˆkSr ©ÚlenZwindow_handlesr ©Ú num_windowsrrr¡sz+number_of_windows_to_be.<locals>._predicater)rarrr`rÚnumber_of_windows_to_bežs rbcs‡fdd„}|S)zdAn expectation that a new window will be opened and have the number of
    windows handles increase.cst|jƒtˆƒkSr r^r ©Úcurrent_handlesrrr«sz(new_window_is_opened.<locals>._predicater)rdrrrcrÚnew_window_is_opened§s recCs dd„}|S)zUAn expectation for checking if an alert is currently present and
    switching to it.cSs&z
|jjWStk
r YdSXdSr&)rIÚalertrr rrrrµs
z$alert_is_present.<locals>._predicater)rrrrÚalert_is_present±srgcs‡‡fdd„}|S)zyAn expectation for checking if the given attribute is included in the
    specified element.
 
    locator, attribute
    cs6z|jˆŽ ˆ¡}|dk    WStk
r0YdSXdSr&r@)r Zelement_attribute©rCrrrrÅs
 
z0element_attribute_to_include.<locals>._predicater)rrCrrrhrÚelement_attribute_to_include¾srics‡fdd„}|S)z²An expectation that any of multiple expected conditions is true.
 
    Equivalent to a logical 'OR'. Returns results of the first matching
    condition, or False if none do.
    c    s>ˆD]4}z||ƒ}|r |WSWqtk
r6YqXqdSr&r©r Úexpected_conditionÚresult©Úexpected_conditionsrrÚany_of_conditionÖsz any_of.<locals>.any_of_conditionr)rnrorrmrÚany_ofÏs
rpcs‡fdd„}|S)aAn expectation that all of multiple expected conditions is true.
 
    Equivalent to a logical 'AND'.
    Returns: When any ExpectedCondition is not met: False.
    When all ExpectedConditions are met: A List with each ExpectedCondition's return value.
    c    sNg}ˆD]@}z"||ƒ}|s"WdS| |¡Wqtk
rFYdSXq|Sr&)Úappendr)r ÚresultsrkrlrmrrÚall_of_conditionës z all_of.<locals>.all_of_conditionr)rnrsrrmrÚall_ofãs rtcs‡fdd„}|S)z„An expectation that none of 1 or multiple expected conditions is true.
 
    Equivalent to a logical 'NOT-OR'. Returns a Boolean
    c    s<ˆD]2}z||ƒ}|rWdSWqtk
r4YqXqdSrLrrjrmrrÚnone_of_conditions z"none_of.<locals>.none_of_conditionr)rnrurrmrÚnone_ofús
rv)T)*r!Zselenium.common.exceptionsrrrrrZ#selenium.webdriver.remote.webdriverrrHrrrrr#r$r%r(r/r'r3r6r8r>rArDrKrOrPrTrUrXrYr[r]rbrergrirprtrvrrrrÚ<module>sL