mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-13 23:02:17 +00:00
19 lines
525 B
TypeScript
19 lines
525 B
TypeScript
import { test as setup } from '@playwright/test';
|
|
import passkeyUtil from './utils/passkey.util';
|
|
import { cleanupBackend } from './utils/cleanup.util';
|
|
|
|
const authFile = 'tests/.auth/user.json';
|
|
|
|
setup('authenticate', async ({ page }) => {
|
|
await cleanupBackend();
|
|
await page.goto('/login');
|
|
|
|
await (await passkeyUtil.init(page)).addPasskey();
|
|
|
|
await page.getByRole('button', { name: 'Authenticate' }).click();
|
|
await page.waitForURL('/settings/account');
|
|
|
|
|
|
await page.context().storageState({ path: authFile });
|
|
});
|