Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/test/e2e/globalSetup.test.ts

27 lines
973 B
TypeScript
Raw Normal View History

2021-04-01 20:48:23 +02: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-01 20:48:23 +02:00
const storageState = JSON.parse(STORAGE) || {}
2021-04-03 01:49:01 +02:00
await jestPlaywright.resetContext({
storageState,
logger: {
isEnabled: (name, severity) => name === "browser",
log: (name, severity, message, args) => console.log(`${name} ${message}`),
},
})
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
2021-04-01 20:48:23 +02:00
})
2021-04-02 21:32:24 +02:00
it("should keep us logged in using the storageState", async () => {
2021-04-01 20:48:23 +02:00
// See the editor
const codeServerEditor = await page.isVisible(".monaco-workbench")
expect(codeServerEditor).toBeTruthy()
})
})