@@ -80,8 +80,12 @@ describe('Liberty Config Language Server Tests for Maven Project', function () {
8080 } ) ;
8181
8282 after ( async function ( ) {
83- this . timeout ( 10000 ) ;
83+ this . timeout ( 30000 ) ;
8484 try {
85+ // Revert any unsaved changes before closing — a dirty editor causes
86+ // VS Code to show a "save?" dialog which blocks closeAllEditors()
87+ await new Workbench ( ) . executeCommand ( 'revert file' ) ;
88+ await wait . sleep ( 500 ) ;
8589 await editorView . closeAllEditors ( ) ;
8690 logger . info ( 'Closed all editors' ) ;
8791 } catch ( error ) {
@@ -314,55 +318,55 @@ describe('Liberty Config Language Server Tests for Maven Project', function () {
314318
315319 describe ( 'Autocomplete for Configuration Stanzas (#392)' , ( ) => {
316320
317- it ( 'Should autocomplete <dataSource > stanza' , async function ( ) {
321+ it ( 'Should autocomplete <logging > stanza' , async function ( ) {
318322 this . timeout ( 60000 ) ;
319- logger . testStart ( 'Testing autocomplete for dataSource stanza' ) ;
323+ logger . testStart ( 'Testing autocomplete for logging stanza' ) ;
320324
321325 editor = await editorView . openEditor ( 'server.xml' ) as TextEditor ;
322326
323327 // The flow: type a partial element name at server level, trigger Ctrl+Space,
324- // select from the dropdown. LCLS inserts <dataSource></dataSource>.
328+ // select from the dropdown. LCLS inserts <logging></logging>.
329+ // Uses 'logging' — available with only jsp-2.3, confirmed locally.
325330 logger . step ( 1 , 'Finding </featureManager> as insertion point' ) ;
326331 const lineNumber = await editor . getLineOfText ( '</featureManager>' ) ;
327332 logger . stepSuccess ( 1 , `Found featureManager end at line ${ lineNumber } ` ) ;
328333
329334 logger . step ( 2 , 'Typing partial stanza name on a new line' ) ;
330- await editor . typeTextAt ( lineNumber + 1 , 1 , ' <dataS ' ) ;
335+ await editor . typeTextAt ( lineNumber + 1 , 1 , ' <loggi ' ) ;
331336 logger . stepSuccess ( 2 , 'Typed partial stanza name' ) ;
332337
333338 logger . step ( 3 , 'Opening content assist for stanza completion' ) ;
334- // waitForCondition ensures the assist is ready before we try to select from it
335339 const assist = await utils . waitForCondition ( async ( ) => {
336340 return await editor . toggleContentAssist ( true ) ?? undefined ;
337341 } , 10 ) ;
338342 // Wait until the target item is present and interactable in the list
339343 await utils . waitForCondition ( async ( ) => {
340344 try {
341- const item = await assist . getItem ( 'dataSource ' ) ;
345+ const item = await assist . getItem ( 'logging ' ) ;
342346 return item ? true : undefined ;
343347 } catch {
344348 return undefined ;
345349 }
346350 } , 10 ) ;
347351 logger . stepSuccess ( 3 , 'Content assist opened' ) ;
348352
349- logger . step ( 4 , 'Selecting "dataSource " from the completion list' ) ;
350- await assist . select ( 'dataSource ' ) ;
353+ logger . step ( 4 , 'Selecting "logging " from the completion list' ) ;
354+ await assist . select ( 'logging ' ) ;
351355 await editor . toggleContentAssist ( false ) ;
352- logger . stepSuccess ( 4 , 'Selected dataSource from completion list' ) ;
356+ logger . stepSuccess ( 4 , 'Selected logging from completion list' ) ;
353357
354- logger . step ( 5 , 'Verifying dataSource stanza was inserted' ) ;
358+ logger . step ( 5 , 'Verifying logging stanza was inserted' ) ;
355359 // Poll until the editor reflects the completion rather than sleeping blindly
356360 const updatedContent = await utils . waitForCondition ( async ( ) => {
357361 const text = await editor . getText ( ) ;
358- return text . includes ( '<dataSource >' ) ? text : undefined ;
362+ return text . includes ( '<logging >' ) ? text : undefined ;
359363 } , 10 ) ;
360- // LCLS inserts <dataSource ></dataSource > (confirmed locally)
361- expect ( updatedContent ) . to . include ( '<dataSource >' ) ;
362- expect ( updatedContent ) . to . include ( '</dataSource >' ) ;
363- logger . stepSuccess ( 5 , 'DataSource stanza autocomplete worked' ) ;
364+ // LCLS inserts <logging ></logging > (confirmed locally)
365+ expect ( updatedContent ) . to . include ( '<logging >' ) ;
366+ expect ( updatedContent ) . to . include ( '</logging >' ) ;
367+ logger . stepSuccess ( 5 , 'Logging stanza autocomplete worked' ) ;
364368
365- logger . testComplete ( 'DataSource stanza autocomplete worked' ) ;
369+ logger . testComplete ( 'Logging stanza autocomplete worked' ) ;
366370 } ) ;
367371
368372 it ( 'Should autocomplete <application> stanza' , async function ( ) {
0 commit comments