Skip to content

Commit f401568

Browse files
committed
Only press enter if not focused after click, fixing highlight tests
Pressing enter when not needed was leading to test failures due to extra new lines getting added
1 parent 7713b97 commit f401568

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

atest/_resources/Keywords.resource

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ Enter Cell Editor
343343
Click Element css:.jp-Cell:nth-child(${cell_nr}) .cm-line:nth-child(${line})
344344
# So it should be focused after click right? Well, not when using this driver
345345
# in JupyterLab 4.1 - we still need to press enter apparently.
346-
Press Keys None ENTER
346+
${focused} Get Element Count css:.jp-Cell:nth-child(${cell_nr}) .cm-focused
347+
Run Keyword If ${focused} == 0 Press Keys None ENTER
347348
Wait Until Page Contains Element css:.jp-Cell:nth-child(${cell_nr}) .cm-focused
348349
# clicking on line does not appear sufficient in CM6 (but still useful because it ensures we have it in view
349350
Execute JavaScript

0 commit comments

Comments
 (0)