Skip to content

Commit

Permalink
collapse _time intermediate
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Jun 11, 2019
1 parent 7fe4b52 commit 55274be
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dash/testing/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,33 @@ def wait_for_element(self, css_selector, timeout=None):

# keep these two wait_for API for easy migration
def wait_for_element_by_css_selector(self, selector, timeout=None):
_time = timeout or self._wait_timeout
return self._wait_for(
EC.presence_of_element_located,
((By.CSS_SELECTOR, selector),),
timeout,
"timeout {}s => waiting for selector {}".format(_time, selector),
"timeout {}s => waiting for selector {}".format(
timeout if timeout else self._wait_timeout, selector
),
)

def wait_for_style_to_equal(self, selector, style, val, timeout=None):
_time = timeout or self._wait_timeout
return self._wait_for(
method=style_to_equal,
args=(selector, style, val),
timeout=timeout,
msg="style val => {} {} not found within {}s".format(
style, val, _time
style, val, timeout if timeout else self._wait_timeout
),
)

def wait_for_text_to_equal(self, selector, text, timeout=None):
_time = timeout or self._wait_timeout
return self._wait_for(
method=text_to_equal,
args=(selector, text),
timeout=timeout,
msg="text -> {} not found within {}s".format(text, _time),
msg="text -> {} not found within {}s".format(
text, timeout if timeout else self._wait_timeout
),
)

def wait_for_page(self, url=None, timeout=10):
Expand Down

0 comments on commit 55274be

Please sign in to comment.