Skip to content

Commit 9e60b7d

Browse files
committed
Tests: Add action click on cell to lab 4 before button click
In lab 4 one needs to click one time on the window to use a button. This click causes the tests to fail for lab 3 because of the window size being to small so we only enable the click in lab 4
1 parent d87da7c commit 9e60b7d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/test_widgets.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,13 @@ def test_widget_answer(self, selenium_driver):
426426
#
427427
WebDriverWait(driver, 1).until(
428428
expected_conditions.element_to_be_clickable(save_button)
429-
).click()
429+
)
430+
from .conftest import JUPYTER_VERSION
431+
432+
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
433+
# button is obscured so we need to click with action on the cell
434+
ActionChains(driver).click(nb_cell).perform()
435+
save_button.click()
430436
# wait for uncued box
431437
cue_box = nb_cell.find_element(By.CLASS_NAME, cue_box_class_name("save", False))
432438
assert "--cued" not in cue_box.get_attribute("class")
@@ -958,7 +964,13 @@ def test_button_clicks(
958964

959965
WebDriverWait(driver, 5).until(
960966
expected_conditions.element_to_be_clickable(check_all_widgets_button)
961-
).click()
967+
)
968+
from .conftest import JUPYTER_VERSION
969+
970+
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
971+
# button is obscured so we need to click with action on the cell
972+
ActionChains(driver).click(nb_cell).perform()
973+
check_all_widgets_button.click()
962974
time.sleep(0.1)
963975
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
964976
assert (

0 commit comments

Comments
 (0)