2021-04-13 22:02:52 +03:00
|
|
|
import { test, expect } from "@playwright/test"
|
2021-04-01 21:48:23 +03:00
|
|
|
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
|
2021-04-13 22:02:52 +03:00
|
|
|
test.describe("globalSetup", () => {
|
|
|
|
// Create a new context with the saved storage state
|
|
|
|
// so we don't have to logged in
|
|
|
|
const storageState = JSON.parse(STORAGE) || {}
|
|
|
|
const options = {
|
|
|
|
contextOptions: {
|
2021-04-03 02:49:01 +03:00
|
|
|
storageState,
|
2021-04-13 22:02:52 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
test("should keep us logged in using the storageState", options, async ({ page }) => {
|
2021-04-02 00:52:46 +03:00
|
|
|
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
2021-04-06 01:18:13 +03:00
|
|
|
// Make sure the editor actually loaded
|
|
|
|
expect(await page.isVisible("div.monaco-workbench"))
|
2021-04-01 21:48:23 +03:00
|
|
|
})
|
|
|
|
})
|