Archived
1
0

refactor: globalSetup and create cookie manually

This commit is contained in:
Joe Previte
2021-04-01 14:52:46 -07:00
parent 51010e73cb
commit c666b47668
7 changed files with 33 additions and 77 deletions

View File

@ -6,12 +6,10 @@ import { CODE_SERVER_ADDRESS, STORAGE } from "../utils/constants"
describe("globalSetup", () => {
beforeEach(async () => {
// Create a new context with the saved storage state
// so we don't have to logged in
const storageState = JSON.parse(STORAGE) || {}
console.log("what is storage ", storageState)
await jestPlaywright.resetContext({ storageState })
await page.goto(CODE_SERVER_ADDRESS)
// code-server takes a second to load
await page.waitForTimeout(1000)
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
})
it("should keep us logged in if we don't reset the browser", async () => {