Skip to content

Commit f484aa3

Browse files
committed
feat: add test for workbench open folder
1 parent ffa5f05 commit f484aa3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/e2e/workbench.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { test, expect } from "@playwright/test"
2+
import { CODE_SERVER_ADDRESS, STORAGE } from "../utils/constants"
3+
import { CodeServer } from "./models/CodeServer"
4+
5+
test.describe("Workbench", () => {
6+
// Create a new context with the saved storage state
7+
// so we don't have to logged in
8+
const options: any = {}
9+
let codeServer: CodeServer
10+
11+
// TODO@jsjoeio
12+
// Fix this once https://github.com/microsoft/playwright-test/issues/240
13+
// is fixed
14+
if (STORAGE) {
15+
const storageState = JSON.parse(STORAGE) || {}
16+
options.contextOptions = {
17+
storageState,
18+
}
19+
}
20+
21+
test.beforeEach(async ({ page }) => {
22+
codeServer = new CodeServer(page)
23+
await codeServer.navigate()
24+
})
25+
26+
test("should open the default folder if not open", options, async ({ page }) => {
27+
await codeServer.openFolder()
28+
29+
// find workspaceStorage in the Explorer menu, which would be open in the User folder
30+
// which is the default folder that opens
31+
expect(await page.isVisible("text=workspaceStorage")).toBe(true)
32+
})
33+
})

0 commit comments

Comments
 (0)