Skip to content

Commit c5bf2bb

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 9f618c6 commit c5bf2bb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/test_widgets.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,12 @@ def test_widget_answer(self, selenium_driver):
440440
#
441441
WebDriverWait(driver, 1).until(
442442
expected_conditions.element_to_be_clickable(save_button)
443-
).click()
443+
)
444+
from .conftest import JUPYTER_VERSION
445+
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
446+
# button is obscured so we need to click with action on the cell
447+
ActionChains(driver).click(nb_cell).perform()
448+
save_button.click()
444449
# wait for uncued box
445450
cue_box = nb_cell.find_element(By.CLASS_NAME, cue_box_class_name("save", False))
446451
assert "--cued" not in cue_box.get_attribute("class")
@@ -972,7 +977,12 @@ def test_button_clicks(
972977

973978
WebDriverWait(driver, 5).until(
974979
expected_conditions.element_to_be_clickable(check_all_widgets_button)
975-
).click()
980+
)
981+
from .conftest import JUPYTER_VERSION
982+
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
983+
# button is obscured so we need to click with action on the cell
984+
ActionChains(driver).click(nb_cell).perform()
985+
check_all_widgets_button.click()
976986
time.sleep(0.1)
977987
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
978988
assert (

0 commit comments

Comments
 (0)