Files
prowler/ui/tests/setups/manage-integrations.auth.setup.ts
Pablo Fernandez Guerra (PFE) f2e6a3264d chore(ui): scope prek pre-commit to staged files, drop legacy husky (#11118)
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:12:25 +02:00

26 lines
888 B
TypeScript

import { test as authManageIntegrationsSetup } from "@playwright/test";
import { SignInPage } from "../sign-in-base/sign-in-base-page";
const manageIntegrationsUserFile =
"playwright/.auth/manage_integrations_user.json";
authManageIntegrationsSetup(
"authenticate as integrations e2e user",
async ({ page }) => {
const integrationsEmail = process.env.E2E_MANAGE_INTEGRATIONS_USER;
const integrationsPassword = process.env.E2E_MANAGE_INTEGRATIONS_PASSWORD;
if (!integrationsEmail || !integrationsPassword) {
throw new Error(
"E2E_MANAGE_INTEGRATIONS_USER and E2E_MANAGE_INTEGRATIONS_PASSWORD environment variables are required",
);
}
const signInPage = new SignInPage(page);
await signInPage.authenticateAndSaveState(
{ email: integrationsEmail, password: integrationsPassword },
manageIntegrationsUserFile,
);
},
);