File tree 2 files changed +20
-8
lines changed
2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,17 @@ export class CodeServer {
92
92
}
93
93
94
94
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" )
101
106
}
102
107
103
108
async quickOpen ( input : string ) {
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ test.describe("Integrated Terminal", () => {
40
40
// await codeServer.viewTerminal()
41
41
await codeServer . focusTerminal ( )
42
42
43
+ // give the terminal a second to load
44
+ await page . waitForTimeout ( 3000 )
43
45
await page . keyboard . type ( `echo '${ testString } ' > ${ tmpFile } ` )
44
46
// Wait for the typing to finish before hitting enter
45
47
await page . waitForTimeout ( 500 )
@@ -51,8 +53,13 @@ test.describe("Integrated Terminal", () => {
51
53
// resolve to undefined
52
54
// If the promise rejects (i.e. the file doesn't exist)
53
55
// then the assertion will fail
54
- expect ( fs . promises . access ( tmpFile ) ) . resolves . toBeUndefined ( )
56
+ await expect ( fs . promises . access ( tmpFile ) ) . resolves . toBeUndefined ( )
55
57
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 / )
57
64
} )
58
65
} )
You can’t perform that action at this time.
0 commit comments