Skip to content

Commit b1ba4cd

Browse files
committed
Tests: Adding sleep to code input test
The change in the last cell does not get active, since the widget has not been loaded fully.
1 parent c8de27d commit b1ba4cd

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/notebooks/widget_scwidgets_code_input.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# ---
1515

1616
# +
17+
import time
18+
1719
import scwidgets
1820
from scwidgets.code import CodeInput
1921

@@ -35,4 +37,5 @@ def foo():
3537
ci
3638
# -
3739

40+
time.sleep(1)
3841
ci.function_body = """return 'change'"""

tests/test_widgets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def test_scwidgets_code_input(selenium_driver):
262262
# -------
263263

264264
# Tests if change in function_body changed the widget view
265+
time.sleep(2)
265266
code_input_lines = nb_cells[2].find_elements(By.CLASS_NAME, CODE_MIRROR_CLASS_NAME)
266267
assert "return 'change'" in code_input_lines[-1].text
267268

0 commit comments

Comments
 (0)