33 * Copyright IBM Corp. 2023, 2026
44 */
55import path = require( 'path' ) ;
6- import { Workbench , InputBox , DefaultTreeItem , ModalDialog , VSBrowser , WaitHelper , BottomBarPanel , OutputView , DebugToolbar } from 'vscode-extension-tester' ;
6+ import { Workbench , InputBox , DefaultTreeItem , ModalDialog , VSBrowser , WaitHelper , BottomBarPanel , OutputView , DebugToolbar , SideBarView } from 'vscode-extension-tester' ;
77import * as fs from 'fs' ;
88import { STOP_DASHBOARD_MAC_ACTION } from '../definitions/constants' ;
99import { MapContextMenuforMac } from './macUtils' ;
@@ -246,7 +246,6 @@ export async function getDashboardSection(sidebar: any): Promise<any> {
246246 return await wait . forCondition ( async ( ) => {
247247 try {
248248 // Re-create SideBarView on every iteration — on mac Previous the sidebar object goes stale during workspace transitions and getSections() returns dead nodes on every call.
249- const { SideBarView } = require ( 'vscode-extension-tester' ) ;
250249 const freshSidebar = new SideBarView ( ) ;
251250 const contentPart = freshSidebar . getContent ( ) ;
252251 const sections = await contentPart . getSections ( ) ;
@@ -285,7 +284,6 @@ export async function getDashboardItem(section: any, projectName: string): Promi
285284 // stale. Getting a fresh section + fresh sidebar each time breaks that loop.
286285 return ( await wait . forCondition ( async ( ) => {
287286 try {
288- const { SideBarView } = require ( 'vscode-extension-tester' ) ;
289287 const freshSection = await getDashboardSection ( new SideBarView ( ) ) ;
290288 await freshSection . expand ( ) ;
291289 await wait . sleep ( 1000 ) ;
@@ -708,7 +706,6 @@ export async function closeWorkspace(): Promise<void> {
708706 // when closeFolder is issued. On Linux this modal blocks the renderer.
709707 try {
710708 await workbench . executeCommand ( 'revert file' ) ;
711- await wait . sleep ( 300 ) ;
712709 } catch { /* no active editor — fine */ }
713710
714711 // Close all open editors first
@@ -745,7 +742,6 @@ export async function closeWorkspace(): Promise<void> {
745742 try {
746743 await wait . forCondition ( async ( ) => {
747744 try {
748- const { SideBarView } = require ( 'vscode-extension-tester' ) ;
749745 const sidebar = new SideBarView ( ) ;
750746 const sections = await sidebar . getContent ( ) . getSections ( ) ;
751747 for ( const sec of sections ) {
@@ -760,7 +756,6 @@ export async function closeWorkspace(): Promise<void> {
760756 } , { timeout : 30000 , pollInterval : 1000 , message : 'Workspace did not finish closing within 30 seconds' } ) ;
761757 } catch {
762758 logger . info ( 'closeWorkspace gate timed out, falling back to fixed wait' ) ;
763- await wait . sleep ( 5000 ) ;
764759 }
765760
766761 logger . info ( 'Workspace closed successfully' ) ;
0 commit comments