code-server-2/test/e2e/login.test.ts

24 lines
742 B
TypeScript
Raw Normal View History

import { test, expect } from "@playwright/test"
2021-03-09 23:33:01 +00:00
import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
2021-01-28 18:48:57 +00:00
test.describe("login", () => {
// Reset the browser so no cookies are persisted
// by emptying the storageState
const options = {
contextOptions: {
storageState: {},
},
}
2021-01-28 18:48:57 +00:00
test("should be able to login", options, async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
2021-01-28 18:48:57 +00:00
// Type in password
await page.fill(".password", PASSWORD)
2021-01-28 18:48:57 +00:00
// 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"))
2021-01-28 18:48:57 +00:00
})
})