@@ -193,14 +193,15 @@ User Can Select Lowercase After Starting Uppercase
193193Mid Token Completions Do Not Overwrite
194194 # `disp<tab>data` → `display_table<cursor>data`
195195 Place Cursor In Cell Editor At 9 line=1 character=4
196- Capture Page Screenshot 01-cursor-placed.png
196+ Wait For Our Completer To Replace Native In Cell 9
197197 Trigger Completer
198198 Completer Should Suggest display_table
199199 Select Completer Suggestion display_table
200200 Capture Page Screenshot 02-completed.png
201201 Wait Until Keyword Succeeds 40x 0.5s Cell Editor Should Equal 9 display_tabledata
202202 # `disp<tab>lay` → `display_table<cursor>`
203203 Place Cursor In Cell Editor At 11 line=1 character=4
204+ Wait For Our Completer To Replace Native In Cell 11
204205 Trigger Completer
205206 Wait For Ready State
206207 Completer Should Suggest display_table
@@ -295,11 +296,7 @@ Completes Correctly With R Double And Triple Colon
295296 [Setup] Prepare File for Editing R completion completion.R
296297 Place Cursor In File Editor At 2 7
297298 Wait Until Fully Initialized
298- # normally the completion adapter taking time to initialise is not a problem
299- # but because the token-based completion fallback would break our test example
300- # if it kicked off we try to avoid it by adding some delay
301- # TODO remove sleep after migrating to JupyterLab 4.0 native adapters.
302- Sleep 2s Workaround completion adapter taking some time to initialize
299+ Wait For Our Completer To Replace Native In File Editor
303300 Trigger Completer
304301 Completer Should Suggest .print.via.format
305302 Select Completer Suggestion .print.via.format
@@ -324,8 +321,7 @@ Shows Documentation With CompletionItem Resolve
324321 [Setup] Prepare File for Editing R completion completion.R
325322 Place Cursor In File Editor At 8 7
326323 Wait Until Fully Initialized
327- # TODO remove sleep after migrating to JupyterLab 4.0 native adapters.
328- Sleep 2s Workaround completion adapter taking some time to initialize
324+ Wait For Our Completer To Replace Native In File Editor
329325 Trigger Completer
330326 Completer Should Suggest print.data.frame
331327 # if data.frame is not active, activate it (it should be in top 10 on any platform)
@@ -352,6 +348,7 @@ Completes In R Magics
352348 # - R lanugage server is very sensitive to off-by-one errors (see https://github.com/REditorSupport/languageserver/issues/395)
353349 # '%%R\n librar<tab>'
354350 Enter Cell Editor 22 line=2
351+ Wait For Our Completer To Replace Native In Cell 22
355352 Trigger Completer
356353 Completer Should Suggest library
357354 # '%R lib<tab>'
@@ -361,6 +358,7 @@ Completes In R Magics
361358
362359Completes Paths In Strings
363360 Enter Cell Editor 26
361+ Wait For Our Completer To Replace Native In Cell 26
364362 Press Keys None LEFT
365363 Trigger Completer
366364 Press Keys None ENTER
@@ -467,3 +465,15 @@ Should Complete While Kernel Is Busy
467465 Completer Should Suggest test
468466 # Confirm that the kernel indicator was busy all along
469467 Page Should Contain Element ${KERNEL_BUSY_INDICATOR }
468+
469+ Wait For Our Completer To Replace Native In File Editor
470+ # Normally the completion adapter taking time to initialise is not a problem
471+ # but because the token-based completion fallback would break some test example
472+ # if it kicked in (by instant-completing some token) so we try to avoid it
473+ # TODO remove after migrating to JupyterLab 4.0 native adapters.
474+ Wait Until Page Contains Element css:.jp-FileEditor .lsp-completer-enabled
475+
476+ Wait For Our Completer To Replace Native In Cell
477+ [Arguments] ${cell_nr }
478+ # TODO remove after migrating to JupyterLab 4.0 native adapters.
479+ Wait Until Page Contains Element css:.jp-Cell:nth-child(${cell_nr } ) .lsp-completer-enabled
0 commit comments