From c4c49b71eaa36769d70833bfcf154a129520ef6f Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sat, 30 Jun 2018 20:22:52 +0200 Subject: [PATCH] Wait for 'New' dropdown button to be clickable for Selenium tests --- notebook/templates/tree.html | 2 +- notebook/tests/selenium/utils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notebook/templates/tree.html b/notebook/templates/tree.html index 295bd77681..adef4c8790 100644 --- a/notebook/templates/tree.html +++ b/notebook/templates/tree.html @@ -61,7 +61,7 @@
- diff --git a/notebook/tests/selenium/utils.py b/notebook/tests/selenium/utils.py index 2c18ec49b1..c93200dc60 100644 --- a/notebook/tests/selenium/utils.py +++ b/notebook/tests/selenium/utils.py @@ -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)