refactor: globalSetup and create cookie manually
This commit is contained in:
@@ -3,8 +3,8 @@ import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
|
||||
|
||||
describe("login", () => {
|
||||
beforeEach(async () => {
|
||||
await jestPlaywright.resetContext()
|
||||
await page.goto(CODE_SERVER_ADDRESS)
|
||||
await jestPlaywright.resetBrowser()
|
||||
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||
})
|
||||
|
||||
it("should be able to login", async () => {
|
||||
@@ -12,9 +12,7 @@ describe("login", () => {
|
||||
await page.fill(".password", PASSWORD)
|
||||
// Click the submit button and login
|
||||
await page.click(".submit")
|
||||
// For some reason, it wasn't waiting for the click and navigation before checking
|
||||
// so adding a timeout ensures that we allow the editor time to load
|
||||
await page.waitForTimeout(1000)
|
||||
await page.waitForLoadState("networkidle")
|
||||
// See the editor
|
||||
const codeServerEditor = await page.isVisible(".monaco-workbench")
|
||||
expect(codeServerEditor).toBeTruthy()
|
||||
|
||||
Reference in New Issue
Block a user