Skip to content

Commit

Permalink
Tests: Add action click on cell to lab 4 before button click
Browse files Browse the repository at this point in the history
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
  • Loading branch information
agoscinski committed Jul 3, 2024
1 parent eee90dd commit 934fe5a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,12 @@ def test_widget_answer(self, selenium_driver):
#
WebDriverWait(driver, 1).until(
expected_conditions.element_to_be_clickable(save_button)
).click()
)
from .conftest import JUPYTER_VERSION
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
# button is obscured so we need to click with action on the cell
ActionChains(driver).click(nb_cell).perform()
save_button.click()
# wait for uncued box
cue_box = nb_cell.find_element(By.CLASS_NAME, cue_box_class_name("save", False))
assert "--cued" not in cue_box.get_attribute("class")
Expand Down Expand Up @@ -972,7 +977,12 @@ def test_button_clicks(

WebDriverWait(driver, 5).until(
expected_conditions.element_to_be_clickable(check_all_widgets_button)
).click()
)
from .conftest import JUPYTER_VERSION
if JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
# button is obscured so we need to click with action on the cell
ActionChains(driver).click(nb_cell).perform()
check_all_widgets_button.click()
time.sleep(0.1)
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
assert (
Expand Down

0 comments on commit 934fe5a

Please sign in to comment.