From ebbabc6e048895423b75d19419206ec0deee43a0 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 15 Apr 2021 15:16:50 -0700 Subject: [PATCH] refactor(testing): combine loginPage with login --- test/e2e/login.test.ts | 6 ++++++ test/e2e/loginPage.test.ts | 18 ------------------ 2 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 test/e2e/loginPage.test.ts diff --git a/test/e2e/login.test.ts b/test/e2e/login.test.ts index 21fcbffc..e3acbf6b 100644 --- a/test/e2e/login.test.ts +++ b/test/e2e/login.test.ts @@ -10,6 +10,12 @@ test.describe("login", () => { }, } + test("should see the login page", options, async ({ page }) => { + await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" }) + // It should send us to the login page + expect(await page.title()).toBe("code-server login") + }) + test("should be able to login", options, async ({ page }) => { await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" }) // Type in password diff --git a/test/e2e/loginPage.test.ts b/test/e2e/loginPage.test.ts deleted file mode 100644 index 3cf1d9cf..00000000 --- a/test/e2e/loginPage.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { test, expect } from "@playwright/test" -import { CODE_SERVER_ADDRESS } from "../utils/constants" - -test.describe("login page", () => { - // Reset the browser so no cookies are persisted - // by emptying the storageState - const options = { - contextOptions: { - storageState: {}, - }, - } - - test("should see the login page", options, async ({ page }) => { - await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" }) - // It should send us to the login page - expect(await page.title()).toBe("code-server login") - }) -})