Archived
1
0

refactor: add login to config.js for e2e tests

This commit is contained in:
Joe Previte
2021-04-13 17:15:07 -07:00
parent 52586706c4
commit 7ea6d22b3e
2 changed files with 67 additions and 8 deletions

View File

@ -6,11 +6,16 @@ import { CODE_SERVER_ADDRESS, STORAGE } from "../utils/constants"
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: {
const options: any = {}
// TODO@jsjoeio
// Fix this once https://github.com/microsoft/playwright-test/issues/240
// is fixed
if (STORAGE) {
const storageState = JSON.parse(STORAGE) || {}
options.contextOptions = {
storageState,
},
}
}
test("should keep us logged in using the storageState", options, async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })