code-server/test/e2e/globalSetup.test.ts

22 lines
772 B
TypeScript
Raw Permalink Normal View History

2021-04-02 02:48:23 +08: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
// so we don't have to logged in
2021-04-02 02:48:23 +08:00
const storageState = JSON.parse(STORAGE) || {}
2021-04-03 07:49:01 +08:00
await jestPlaywright.resetContext({
storageState,
})
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
2021-04-02 02:48:23 +08:00
})
2021-04-03 03:32:24 +08:00
it("should keep us logged in using the storageState", async () => {
// Make sure the editor actually loaded
expect(await page.isVisible("div.monaco-workbench"))
2021-04-02 02:48:23 +08:00
})
})