Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfulton9 committed Nov 7, 2024
1 parent 4832cc4 commit 2f9458d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions nbclassic/tests/end_to_end/test_save_as_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def attempt_form_fill_and_save(notebook_path):
# This may be a retry, check if the application state reflects a successful save operation
nonlocal fill_attempts
if fill_attempts and get_notebook_name(notebook_frontend) == notebook_path.split("/")[-1]:
print('[Test] Success from previous save attempt!')
print('[Test] Success from previous save attempt!')
return True
fill_attempts += 1
print(f'[Test] Attempt form fill with directory and save #{fill_attempts}')
Expand All @@ -69,17 +69,13 @@ def attempt_form_fill_and_save(notebook_path):

# Set the notebook name field in the save dialog
print('[Test] Fill the input field')

elem_string = f'(elem) => {{ elem.value = "{notebook_path}"; return elem.value; }}'
name_input_element.evaluate(f'(elem) => {{ elem.value = "{notebook_path}"; return elem.value; }}')
condition = notebook_frontend.wait_for_condition(
notebook_frontend.wait_for_condition(
lambda: name_input_element.evaluate(
f'(elem) => {{ elem.value = "{notebook_path}"; return elem.value; }}') == notebook_path,
timeout=120,
period=.25
)
if condition is None:
raise RuntimeError
# Show the input field value
print('[Test] Name input field contents:')
field_value = name_input_element.evaluate(f'(elem) => {{ return elem.value; }}')
Expand Down

0 comments on commit 2f9458d

Please sign in to comment.