File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed
Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -126,24 +126,17 @@ def main():
126126
127127 if cell_is_waiting_for_input (driver ):
128128 print ("Cell requesting input" )
129- actions .send_keys ("Test_Name" ).perform ()
130- time .sleep (0.75 )
131- actions .send_keys (Keys .CONTROL , Keys .ENTER )
132- time .sleep (0.75 )
133- actions .move_to_element (focused_cell ).perform ()
134- time .sleep (0.75 )
135- driver .execute_script ("""
136- var el = document.activeElement;
137- var evt = new KeyboardEvent('keydown', {
138- key: 'ArrowDown',
139- code: 'ArrowDown',
140- keyCode: 40,
141- which: 40,
142- bubbles: true
143- });
144- el.dispatchEvent(evt);
145- """ )
146- time .sleep (0.75 )
129+ input_box = WebDriverWait (driver , 5 ).until (
130+ EC .visibility_of_element_located ((By .CSS_SELECTOR , ".jp-Stdin-input" ))
131+ )
132+ input_box .click ()
133+ input_box .send_keys ("Test_Name" )
134+ time .sleep (10 )
135+ input_box .send_keys (Keys .CONTROL , Keys .ENTER )
136+ next_cell = focused_cell .find_element (
137+ By .XPATH , "following-sibling::div[contains(@class,'jp-Notebook-cell')][1]"
138+ )
139+ driver .execute_script ("arguments[0].scrollIntoView({block:'center'});" , next_cell )
147140 os_name = platform .system ()
148141
149142 if os_name == "Darwin" :
You can’t perform that action at this time.
0 commit comments