mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Merge pull request #3726 from takluyver/selenium-newnb-clickable
Wait for 'New' dropdown button to be clickable for Selenium tests
This commit is contained in:
commit
9d0ea1a427
@ -61,7 +61,7 @@ data-server-root="{{server_root}}"
|
||||
</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>
|
||||
|
@ -231,7 +231,8 @@ class Notebook:
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user