Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Wait for 'New' dropdown button to be clickable for Selenium tests #3726

Merged
merged 1 commit into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notebook/templates/tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</span>
</form>
<div id="new-buttons" class="btn-group">
<button class="dropdown-toggle btn btn-default btn-xs" data-toggle="dropdown">
<button class="dropdown-toggle btn btn-default btn-xs" id="new-dropdown-button" data-toggle="dropdown">
<span>{% trans %}New{% endtrans %}</span>
<span class="caret"></span>
</button>
Expand Down
3 changes: 2 additions & 1 deletion notebook/tests/selenium/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def new_notebook(cls, browser, kernel_name='kernel-python3'):
def select_kernel(browser, kernel_name='kernel-python3'):
"""Clicks the "new" button and selects a kernel from the options.
"""
new_button = wait_for_selector(browser, "#new-buttons", single=True)
wait = WebDriverWait(browser, 10)
new_button = wait.until(EC.element_to_be_clickable((By.ID, "new-dropdown-button")))
new_button.click()
kernel_selector = '#{} a'.format(kernel_name)
kernel = wait_for_selector(browser, kernel_selector, single=True)
Expand Down