Skip to content

Instantly share code, notes, and snippets.

@corradin
Last active April 7, 2023 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corradin/4c60e47b7f2e76b55bb4ce8ac0656668 to your computer and use it in GitHub Desktop.
Save corradin/4c60e47b7f2e76b55bb4ce8ac0656668 to your computer and use it in GitHub Desktop.
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