refactor(testing): combine loginPage with login

This commit is contained in:
Joe Previte 2021-04-15 15:16:50 -07:00
parent 58e17c5e50
commit ebbabc6e04
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24
2 changed files with 6 additions and 18 deletions

View File

@ -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 }) => { test("should be able to login", options, async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" }) await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
// Type in password // Type in password

View File

@ -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")
})
})