feat(testing): add e2e tests for password

This commit is contained in:
Joe Previte 2021-04-15 15:27:17 -07:00
parent ebbabc6e04
commit faaa0a9e60
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24
1 changed files with 19 additions and 0 deletions

View File

@ -26,4 +26,23 @@ test.describe("login", () => {
// Make sure the editor actually loaded
expect(await page.isVisible("div.monaco-workbench"))
})
test("should see an error message for missing password", options, async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
// Skip entering password
// Click the submit button and login
await page.click(".submit")
await page.waitForLoadState("networkidle")
expect(await page.isVisible("text=Missing password"))
})
test("should see an error message for incorrect password", options, async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
// Type in password
await page.fill(".password", "password123")
// Click the submit button and login
await page.click(".submit")
await page.waitForLoadState("networkidle")
expect(await page.isVisible("text=Incorrect password"))
})
})