login.test.ts 629 字节
Newer Older
1
/// <reference types="jest-playwright-preset" />
2
import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
J
Joe Previte 已提交
3 4 5

describe("login", () => {
  beforeEach(async () => {
6
    await jestPlaywright.resetBrowser()
7
    await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
J
Joe Previte 已提交
8 9
  })

10
  it("should be able to login", async () => {
J
Joe Previte 已提交
11
    // Type in password
12
    await page.fill(".password", PASSWORD)
J
Joe Previte 已提交
13 14
    // Click the submit button and login
    await page.click(".submit")
15
    await page.waitForLoadState("networkidle")
16 17
    // Make sure the editor actually loaded
    expect(await page.isVisible("div.monaco-workbench"))
J
Joe Previte 已提交
18 19
  })
})