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