Files
pocket-id/frontend/tests/auth.setup.ts

18 lines
521 B
TypeScript
Raw Normal View History

2024-08-12 11:00:25 +02:00
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 }) => {
2025-01-19 15:41:16 +01:00
await cleanupBackend();
2024-08-12 11:00:25 +02:00
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 });
});