Skip to content

Commit 4170f27

Browse files
committed
Try to fix Safari (running cells)
1 parent 15f0d52 commit 4170f27

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/automated-notebook-run-script.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ def main():
139139
"arguments[0].scrollIntoView({block:'center'});", next_cell
140140
)
141141
next_cell.click()
142+
if args.driver == "safari":
143+
driver.execute_script(
144+
"""
145+
const evt = new KeyboardEvent('keydown', {
146+
key: 'Enter',
147+
code: 'Enter',
148+
keyCode: 13,
149+
which: 13,
150+
shiftKey: true,
151+
bubbles: true
152+
});
153+
document.activeElement.dispatchEvent(evt);
154+
"""
155+
)
142156
while True:
143157
spans = driver.find_elements(By.CSS_SELECTOR, "span.jp-StatusBar-TextItem")
144158
status_span = spans[2]

0 commit comments

Comments
 (0)