File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,17 @@ export class CodeServer {
9292 }
9393
9494 async focusTerminal ( ) {
95- // TODO@jsjoeio combine viewTerminal and focusTerminal
96- // check if terminal is open before hitting keyboard shortcut
97- // otherwise it will close it
98- await this . page . keyboard . press ( "Control+Backquote" )
99- // Give the terminal a second to load, change shells, etc.
100- await this . page . waitForTimeout ( 1500 )
95+ // Open using the manu
96+ // Click [aria-label="Application Menu"] div[role="none"]
97+ await this . page . click ( '[aria-label="Application Menu"] div[role="none"]' )
98+
99+ // Click text=View
100+ await this . page . hover ( "text=View" )
101+ await this . page . click ( "text=View" )
102+
103+ // Click text=Terminal
104+ await this . page . hover ( "text=Terminal" )
105+ await this . page . click ( "text=Terminal" )
101106 }
102107
103108 async quickOpen ( input : string ) {
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ test.describe("Integrated Terminal", () => {
4040 // await codeServer.viewTerminal()
4141 await codeServer . focusTerminal ( )
4242
43+ // give the terminal a second to load
44+ await page . waitForTimeout ( 3000 )
4345 await page . keyboard . type ( `echo '${ testString } ' > ${ tmpFile } ` )
4446 // Wait for the typing to finish before hitting enter
4547 await page . waitForTimeout ( 500 )
@@ -51,8 +53,13 @@ test.describe("Integrated Terminal", () => {
5153 // resolve to undefined
5254 // If the promise rejects (i.e. the file doesn't exist)
5355 // then the assertion will fail
54- expect ( fs . promises . access ( tmpFile ) ) . resolves . toBeUndefined ( )
56+ await expect ( fs . promises . access ( tmpFile ) ) . resolves . toBeUndefined ( )
5557
56- // TODO delete tmpFolder
58+ await fs . promises . rmdir ( tmpFolderPath , { recursive : true } )
59+ // Make sure neither file nor folder exist
60+ // @ts -ignore
61+ expect ( fs . promises . access ( tmpFile ) ) . rejects . toThrowError ( / n o s u c h f i l e o r d i r e c t o r y / )
62+ // @ts -ignore
63+ expect ( fs . promises . access ( tmpFolderPath ) ) . rejects . toThrowError ( / n o s u c h f i l e o r d i r e c t o r y / )
5764 } )
5865} )
You can’t perform that action at this time.
0 commit comments