Last active
March 28, 2023 21:51
-
-
Save corradin/7632ea89e37ba895e828a13445f1544d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { chromium } from '@playwright/test'; | |
import login from './utils/login'; | |
const username = process.env.MEETUP_USERNAME ?? ''; | |
const password = process.env.MEETUP_PASSWORD ?? ''; | |
async function globalSetup(config: FullConfig): Promise<void> { | |
const { storageState } = config.projects[0].use; | |
// TODO: Remove headless after this has been tested | |
const browser = await chromium.launch({ headless: false }); | |
const page = await browser.newPage(); | |
await login(page, username, password); | |
await page.context().storageState({ | |
path: storageState, | |
}); | |
await browser.close(); | |
} | |
export default globalSetup; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@corradin It doesn't save the storageState to the designated path either which is making my test fail. Thanks for the help!
Global set up updated