@@ -29,6 +29,51 @@ export class CodeServer {
29
29
await this . page . keyboard . press ( "Enter" )
30
30
await this . page . waitForLoadState ( "networkidle" )
31
31
}
32
+ // TODO@jsjoeio
33
+ // you're not using absolutePath. either remove or use
34
+ }
35
+
36
+ /**
37
+ * Creates a temproary folder in the User folder
38
+ * with the name "e2e_test_temp_folder"
39
+ * unless tempFolderName is passed in
40
+ */
41
+ async createTempFolder ( tempFolderName = "e2e_test_temp_folder" ) {
42
+ // Open User folder
43
+ await this . openFolder ( )
44
+
45
+ // Click the Explorer file area
46
+ // Otherwise, when we create a folder, it could create it
47
+ // in another folder based on where the cursor last was
48
+ await this . page . click ( ".explorer-folders-view" )
49
+ // Create new folder
50
+ await this . page . keyboard . press ( "Meta+Shift+P" )
51
+ await this . page . keyboard . type ( "File: New Folder" )
52
+ // Let the typing finish
53
+ await this . page . waitForTimeout ( 1000 )
54
+ await this . page . keyboard . press ( "Enter" )
55
+ await this . page . keyboard . type ( tempFolderName )
56
+ // Let the typing finish
57
+ await this . page . waitForTimeout ( 1000 )
58
+ await this . page . keyboard . press ( "Enter" )
59
+ }
60
+
61
+ async deleteTempFolder ( tempFolderName = "e2e_test_temp_folder" ) {
62
+ // how to delete?
63
+ // Check if folder is visible
64
+ const tempFolderSelector = `text=${ tempFolderName } `
65
+ const folderExists = await this . page . isVisible ( tempFolderSelector )
66
+
67
+ if ( folderExists ) {
68
+ await this . page . click ( tempFolderSelector , { button : "right" } )
69
+ // Click text=Delete Permanently
70
+ await this . page . click ( "text=Delete Permanently" )
71
+
72
+ // Click text=Delete
73
+ await this . page . click ( "text=Delete" )
74
+ // Give it a second to disappear
75
+ await this . page . waitForTimeout ( 1000 )
76
+ }
32
77
}
33
78
34
79
/**
@@ -47,7 +92,12 @@ export class CodeServer {
47
92
}
48
93
49
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
50
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 )
51
101
}
52
102
53
103
async quickOpen ( input : string ) {
0 commit comments