2021-04-01 18:48:23 +00:00
|
|
|
/// <reference types="jest-playwright-preset" />
|
|
|
|
import { CODE_SERVER_ADDRESS, STORAGE } from "../utils/constants"
|
|
|
|
|
|
|
|
// This test is to make sure the globalSetup works as expected
|
|
|
|
// meaning globalSetup ran and stored the storageState in STORAGE
|
|
|
|
describe("globalSetup", () => {
|
|
|
|
beforeEach(async () => {
|
|
|
|
// Create a new context with the saved storage state
|
2021-04-01 21:52:46 +00:00
|
|
|
// so we don't have to logged in
|
2021-04-01 18:48:23 +00:00
|
|
|
const storageState = JSON.parse(STORAGE) || {}
|
|
|
|
await jestPlaywright.resetContext({ storageState })
|
2021-04-01 21:52:46 +00:00
|
|
|
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
2021-04-01 18:48:23 +00:00
|
|
|
})
|
|
|
|
|
2021-04-02 19:32:24 +00:00
|
|
|
it("should keep us logged in using the storageState", async () => {
|
2021-04-01 18:48:23 +00:00
|
|
|
// See the editor
|
|
|
|
const codeServerEditor = await page.isVisible(".monaco-workbench")
|
|
|
|
expect(codeServerEditor).toBeTruthy()
|
|
|
|
})
|
|
|
|
})
|