Skip to content

Commit dd05d75

Browse files
committed
feat: add test for globalSetup
1 parent 9bf5cc2 commit dd05d75

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/e2e/globalSetup.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference types="jest-playwright-preset" />
2+
import { CODE_SERVER_ADDRESS, STORAGE } from "../utils/constants"
3+
4+
// This test is to make sure the globalSetup works as expected
5+
// meaning globalSetup ran and stored the storageState in STORAGE
6+
describe("globalSetup", () => {
7+
beforeEach(async () => {
8+
// Create a new context with the saved storage state
9+
const storageState = JSON.parse(STORAGE) || {}
10+
console.log("what is storage ", storageState)
11+
await jestPlaywright.resetContext({ storageState })
12+
await page.goto(CODE_SERVER_ADDRESS)
13+
// code-server takes a second to load
14+
await page.waitForTimeout(1000)
15+
})
16+
17+
it("should keep us logged in if we don't reset the browser", async () => {
18+
// See the editor
19+
const codeServerEditor = await page.isVisible(".monaco-workbench")
20+
expect(codeServerEditor).toBeTruthy()
21+
})
22+
})

0 commit comments

Comments
 (0)