Files
pocket-id/frontend/tests/auth.setup.ts
Elias Schneider eaff977b22 initial commit
2024-08-12 11:24:22 +02:00

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 });
});