Skip to content

Commit b97c760

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 3992647 commit b97c760

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
@@ -429,7 +429,13 @@ def test_widget_answer(self, selenium_driver):
429429
#
430430
WebDriverWait(driver, 1).until(
431431
expected_conditions.element_to_be_clickable(save_button)
432-
).click()
432+
)
433+
from .conftest import JUPYTER_VERSION
434+
435+
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
436+
# button is obscured so we need to click with action on the cell
437+
ActionChains(driver).click(nb_cell).perform()
438+
save_button.click()
433439
# wait for uncued box
434440
cue_box = nb_cell.find_element(By.CLASS_NAME, cue_box_class_name("save", False))
435441
assert "--cued" not in cue_box.get_attribute("class")
@@ -961,7 +967,13 @@ def test_button_clicks(
961967

962968
WebDriverWait(driver, 5).until(
963969
expected_conditions.element_to_be_clickable(check_all_widgets_button)
964-
).click()
970+
)
971+
from .conftest import JUPYTER_VERSION
972+
973+
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
974+
# button is obscured so we need to click with action on the cell
975+
ActionChains(driver).click(nb_cell).perform()
976+
check_all_widgets_button.click()
965977
time.sleep(0.1)
966978
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
967979
assert (

0 commit comments

Comments
 (0)