Explicit wait until an element is NOT found. timeout defaults to the fixture's `wait_timeout`.
(self, selector, timeout=None)
| 310 | ) |
| 311 | |
| 312 | def wait_for_no_elements(self, selector, timeout=None): |
| 313 | """Explicit wait until an element is NOT found. timeout defaults to |
| 314 | the fixture's `wait_timeout`.""" |
| 315 | until( |
| 316 | # if we use get_elements it waits a long time to see if they appear |
| 317 | # so this one calls out directly to execute_script |
| 318 | lambda: self.driver.execute_script( |
| 319 | f"return document.querySelectorAll('{selector}').length" |
| 320 | ) |
| 321 | == 0, |
| 322 | timeout or self._wait_timeout, |
| 323 | ) |
| 324 | |
| 325 | def wait_for_element_by_id(self, element_id, timeout=None): |
| 326 | """Explicit wait until the element is present, timeout if not set, |