Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature Request] dash.testing.browser should allow custom timeout on wait_for_page() #1595

Closed
iynehz opened this issue Apr 15, 2021 · 3 comments · Fixed by #2417
Closed

Comments

@iynehz
Copy link

iynehz commented Apr 15, 2021

While wait_for_page() the function itself is possible to take a timeout parameter, looks like when it's called in dash.testing.browser it is now always 10 sec for selenium to wait for dash app to serve.

self.wait_for_page()

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

At our workplace we have some "heavy" setups on our dash apps. And I get error when trying out dash.testing like wait_for_page(347): dash server is not loaded within 10 seconds...

@alexcjohnson
Copy link
Collaborator

Ah, and I presume you're using dash_duo.start_server(app) which then throws an error on timeout, so you can't simply add another wait after that.

Looks like we should have wait_for_page work like the other wait_for_* methods, that set default timeout=None and then use it like timeout if timeout else self._wait_timeout

Then you'd be able to set dash_duo._wait_timeout to whatever you want, prior to calling start_server - though I notice we bake the timeout set on __init__ into _wd_wait and use it in _wait_for - let's just get rid of _wd_wait, I can't imagine a command that's specifically designed to wait caring about the cost of creating a new WebDriverWait object...

@iynehz
Copy link
Author

iynehz commented Apr 16, 2021

@alexcjohnson Thanks for the comment. I didn't go to _wd_wait that level of details, but your understanding of my issue is exact. I was thinking you can change to use self._wait_timeout at this place

self.wait_for_page()
But your idea of changing wait_for_page looks better.

@amirhessam88
Copy link

is there any update on this ? I am hitting the same error

dash.testing.browser:browser.py:395 dash server is not loaded within 10 seconds

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@alexcjohnson @amirhessam88 @iynehz and others