From faaa0a9e600e12f65a0dc6ecd22c4bb9d7463034 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 15 Apr 2021 15:27:17 -0700 Subject: [PATCH] feat(testing): add e2e tests for password --- test/e2e/login.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/e2e/login.test.ts b/test/e2e/login.test.ts index e3acbf6bc..91303ffe1 100644 --- a/test/e2e/login.test.ts +++ b/test/e2e/login.test.ts @@ -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")) + }) })