mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-17 17:41:50 +00:00
985d73f44f
Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com>
15 lines
582 B
TypeScript
15 lines
582 B
TypeScript
import { test as authAdminSetup } from '@playwright/test';
|
|
import { authenticateAndSaveState } from '@/tests/helpers';
|
|
|
|
const adminUserFile = 'playwright/.auth/admin_user.json';
|
|
|
|
authAdminSetup('authenticate as admin e2e user', async ({ page }) => {
|
|
const adminEmail = process.env.E2E_ADMIN_USER;
|
|
const adminPassword = process.env.E2E_ADMIN_PASSWORD;
|
|
|
|
if (!adminEmail || !adminPassword) {
|
|
throw new Error('E2E_ADMIN_USER and E2E_ADMIN_PASSWORD environment variables are required');
|
|
}
|
|
|
|
await authenticateAndSaveState(page, adminEmail, adminPassword, adminUserFile);
|
|
}); |