mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-14 07:12:19 +00:00
initial commit
This commit is contained in:
18
frontend/tests/auth.setup.ts
Normal file
18
frontend/tests/auth.setup.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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 });
|
||||
});
|
||||
Reference in New Issue
Block a user