Last active
April 7, 2023 11:24
-
-
Save corradin/4c60e47b7f2e76b55bb4ce8ac0656668 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 { test as setup } from '@playwright/test'; | |
import { storageStatePath } from './playwright.config'; | |
const username = process.env.MEETUP_USERNAME ?? ''; | |
const password = process.env.MEETUP_PASSWORD ?? ''; | |
setup('Login a user', async ({ page }) => { | |
await page.goto('https://www.meetup.com/login'); | |
await page.getByLabel('Email').fill(username); | |
await page.getByLabel('Password', { exact: true }).fill(password); | |
await Promise.all([ | |
page.waitForURL('https://www.meetup.com/home/**'), | |
page.getByRole('button', { name: 'Log in', exact: true }).click(), | |
]); | |
await page.context().storageState({ | |
path: storageStatePath, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment