mirror of https://git.tuxpa.in/a/code-server.git
24 lines
742 B
TypeScript
24 lines
742 B
TypeScript
import { test, expect } from "@playwright/test"
|
|
import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
|
|
|
|
test.describe("login", () => {
|
|
// Reset the browser so no cookies are persisted
|
|
// by emptying the storageState
|
|
const options = {
|
|
contextOptions: {
|
|
storageState: {},
|
|
},
|
|
}
|
|
|
|
test("should be able to login", options, async ({ page }) => {
|
|
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
|
// Type in password
|
|
await page.fill(".password", PASSWORD)
|
|
// Click the submit button and login
|
|
await page.click(".submit")
|
|
await page.waitForLoadState("networkidle")
|
|
// Make sure the editor actually loaded
|
|
expect(await page.isVisible("div.monaco-workbench"))
|
|
})
|
|
})
|