@@ -2228,7 +2228,7 @@ def switch_to_frame(self, frame, timeout=None):
2228
2228
2229
2229
def switch_to_default_content (self ):
2230
2230
"""Brings driver control outside the current iframe.
2231
- (If driver control is inside an iframe, the driver control
2231
+ (If the driver control is inside an iframe, the driver control
2232
2232
will be set to one level above the current frame. If the driver
2233
2233
control is not currently in an iframe, nothing will happen.)"""
2234
2234
self .__check_scope ()
@@ -5224,8 +5224,9 @@ def wait_for_element_not_present(
5224
5224
"""Same as self.wait_for_element_absent()
5225
5225
Waits for an element to no longer appear in the HTML of a page.
5226
5226
A hidden element still counts as appearing in the page HTML.
5227
- If an element with "hidden" status is acceptable,
5228
- use wait_for_element_not_visible() instead."""
5227
+ If waiting for elements to be hidden instead of nonexistent,
5228
+ use wait_for_element_not_visible() instead.
5229
+ """
5229
5230
self .__check_scope ()
5230
5231
if not timeout :
5231
5232
timeout = settings .LARGE_TIMEOUT
@@ -5241,6 +5242,10 @@ def assert_element_not_present(
5241
5242
):
5242
5243
"""Same as self.assert_element_absent()
5243
5244
Will raise an exception if the element stays present.
5245
+ A hidden element counts as a present element, which fails this assert.
5246
+ If you want to assert that elements are hidden instead of nonexistent,
5247
+ use assert_element_not_visible() instead.
5248
+ (Note that hidden elements are still present in the HTML of the page.)
5244
5249
Returns True if successful. Default timeout = SMALL_TIMEOUT."""
5245
5250
self .__check_scope ()
5246
5251
if not timeout :
@@ -8121,9 +8126,10 @@ def wait_for_element_absent(
8121
8126
self , selector , by = By .CSS_SELECTOR , timeout = None
8122
8127
):
8123
8128
"""Waits for an element to no longer appear in the HTML of a page.
8124
- A hidden element still counts as appearing in the page HTML.
8125
- If an element with "hidden" status is acceptable,
8126
- use wait_for_element_not_visible() instead."""
8129
+ A hidden element counts as a present element, which fails this assert.
8130
+ If waiting for elements to be hidden instead of nonexistent,
8131
+ use wait_for_element_not_visible() instead.
8132
+ """
8127
8133
self .__check_scope ()
8128
8134
if not timeout :
8129
8135
timeout = settings .LARGE_TIMEOUT
@@ -8137,8 +8143,12 @@ def wait_for_element_absent(
8137
8143
def assert_element_absent (
8138
8144
self , selector , by = By .CSS_SELECTOR , timeout = None
8139
8145
):
8140
- """Similar to wait_for_element_absent() - returns nothing.
8146
+ """Similar to wait_for_element_absent()
8141
8147
As above, will raise an exception if the element stays present.
8148
+ A hidden element counts as a present element, which fails this assert.
8149
+ If you want to assert that elements are hidden instead of nonexistent,
8150
+ use assert_element_not_visible() instead.
8151
+ (Note that hidden elements are still present in the HTML of the page.)
8142
8152
Returns True if successful. Default timeout = SMALL_TIMEOUT."""
8143
8153
self .__check_scope ()
8144
8154
if not timeout :
@@ -8169,7 +8179,7 @@ def wait_for_element_not_visible(
8169
8179
def assert_element_not_visible (
8170
8180
self , selector , by = By .CSS_SELECTOR , timeout = None
8171
8181
):
8172
- """Similar to wait_for_element_not_visible() - returns nothing.
8182
+ """Similar to wait_for_element_not_visible()
8173
8183
As above, will raise an exception if the element stays visible.
8174
8184
Returns True if successful. Default timeout = SMALL_TIMEOUT."""
8175
8185
self .__check_scope ()
0 commit comments