Skip to content

Commit faaa0a9

Browse files
committed
feat(testing): add e2e tests for password
1 parent ebbabc6 commit faaa0a9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/e2e/login.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,23 @@ test.describe("login", () => {
2626
// Make sure the editor actually loaded
2727
expect(await page.isVisible("div.monaco-workbench"))
2828
})
29+
30+
test("should see an error message for missing password", options, async ({ page }) => {
31+
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
32+
// Skip entering password
33+
// Click the submit button and login
34+
await page.click(".submit")
35+
await page.waitForLoadState("networkidle")
36+
expect(await page.isVisible("text=Missing password"))
37+
})
38+
39+
test("should see an error message for incorrect password", options, async ({ page }) => {
40+
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
41+
// Type in password
42+
await page.fill(".password", "password123")
43+
// Click the submit button and login
44+
await page.click(".submit")
45+
await page.waitForLoadState("networkidle")
46+
expect(await page.isVisible("text=Incorrect password"))
47+
})
2948
})

0 commit comments

Comments
 (0)