File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,31 @@ export const startVSCode = async (
5858 const window = await electronApp . firstWindow ( )
5959 await window . waitForLoadState ( 'domcontentloaded' )
6060 await window . waitForLoadState ( 'networkidle' )
61+ await clickExplorerTab ( window )
62+
6163 return {
6264 window,
6365 close : async ( ) => {
6466 await electronApp . close ( )
65- await fs . removeSync ( userDataDir )
67+ await fs . remove ( userDataDir )
6668 } ,
6769 }
6870}
71+
72+ /**
73+ * Click on the Explorer tab in the VS Code activity bar if the Explorer tab is not already active.
74+ * This is necessary because the Explorer tab may not be visible if the user has not opened it yet.
75+ */
76+ export const clickExplorerTab = async ( page : Page ) : Promise < void > => {
77+ const isExplorerActive = await page . locator ( "text='Explorer'" ) . isVisible ( )
78+ if ( ! isExplorerActive ) {
79+ // Wait for the activity bar to be loaded
80+ await page . waitForSelector ( '.actions-container[role="tablist"]' )
81+
82+ // Click on the Explorer tab using the codicon class
83+ await page . click ( '.codicon-explorer-view-icon' )
84+
85+ // Wait a bit for the explorer view to activate
86+ await page . locator ( "text='Explorer'" ) . waitFor ( { state : 'visible' } )
87+ }
88+ }
You can’t perform that action at this time.
0 commit comments