mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-04 19:21:51 +00:00
f2e6a3264d
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
682 B
TypeScript
22 lines
682 B
TypeScript
import { test as authAdminSetup } from "@playwright/test";
|
|
import { SignInPage } from "../sign-in-base/sign-in-base-page";
|
|
|
|
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",
|
|
);
|
|
}
|
|
|
|
const signInPage = new SignInPage(page);
|
|
await signInPage.authenticateAndSaveState(
|
|
{ email: adminEmail, password: adminPassword },
|
|
adminUserFile,
|
|
);
|
|
});
|