Same as assert_element()
(self, selector, timeout=None)
| 3210 | return True |
| 3211 | |
| 3212 | def assert_element_visible(self, selector, timeout=None): |
| 3213 | """Same as assert_element()""" |
| 3214 | if not timeout: |
| 3215 | timeout = settings.SMALL_TIMEOUT |
| 3216 | failure = False |
| 3217 | message = "" |
| 3218 | try: |
| 3219 | self.select(selector, timeout=timeout) |
| 3220 | except Exception: |
| 3221 | failure = True |
| 3222 | plural = "s" |
| 3223 | if timeout == 1: |
| 3224 | plural = "" |
| 3225 | msg = "\n Element {%s} was not found after %s second%s!" |
| 3226 | message = msg % (selector, timeout, plural) |
| 3227 | if failure: |
| 3228 | raise Exception(message) |
| 3229 | for i in range(30): |
| 3230 | if self.is_element_visible(selector): |
| 3231 | return True |
| 3232 | time.sleep(0.1) |
| 3233 | raise Exception("Element {%s} was not visible!" % selector) |
| 3234 | |
| 3235 | def assert_element_present(self, selector, timeout=None): |
| 3236 | """Assert element is present in the DOM. (Visibility NOT required)""" |
no test coverage detected