Skip to content

Commit 3be2656

Browse files
committed
wipp
1 parent d4e5738 commit 3be2656

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

test/e2e/models/CodeServer.ts

+50
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,51 @@ export class CodeServer {
2929
await this.page.keyboard.press("Enter")
3030
await this.page.waitForLoadState("networkidle")
3131
}
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+
}
3277
}
3378

3479
/**
@@ -47,7 +92,12 @@ export class CodeServer {
4792
}
4893

4994
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
5098
await this.page.keyboard.press("Control+Backquote")
99+
// Give the terminal a second to load, change shells, etc.
100+
await this.page.waitForTimeout(1500)
51101
}
52102

53103
async quickOpen(input: string) {

0 commit comments

Comments
 (0)