From a7495539038b19c58834013c0c8b57d0385e5f9d Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Wed, 12 Nov 2025 12:44:07 +0100 Subject: [PATCH] fix pw setup --- playwright/tests/auth.setup.ts | 36 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/playwright/tests/auth.setup.ts b/playwright/tests/auth.setup.ts index 71929959873..6f407fc1b97 100644 --- a/playwright/tests/auth.setup.ts +++ b/playwright/tests/auth.setup.ts @@ -4,8 +4,6 @@ import { APIRequestContext, test as setup } from "@playwright/test"; import fs from "fs"; import path from "path"; -setup.describe.configure({ mode: "serial" }); - const authenticateAndSaveState = async ( request: APIRequestContext, email: string, @@ -48,20 +46,24 @@ const authSetup = async ( } }; -setup("Authenticate as admin via API", async ({ request }) => { - await authSetup( - request, - process.env.E2E_USER_NAME!, - process.env.E2E_USER_PASSWORD!, - "admin.json", - ); -}); - -const user: UserPermissionType = USER_PERMISSION; -const password: string = process.env.E2E_PERMISSIONS_USERS_PASSWORD!; +setup.describe(() => { + setup.describe.configure({ mode: "serial" }); -for (const permission of permissions) { - setup(`Authenticate as ${permission} user via API`, async ({ request }) => { - await authSetup(request, user[permission], password, `${permission}.json`); + setup("Authenticate as admin via API", async ({ request }) => { + await authSetup( + request, + process.env.E2E_USER_NAME!, + process.env.E2E_USER_PASSWORD!, + "admin.json", + ); }); -} + + const user: UserPermissionType = USER_PERMISSION; + const password: string = process.env.E2E_PERMISSIONS_USERS_PASSWORD!; + + for (const permission of permissions) { + setup(`Authenticate as ${permission} user via API`, async ({ request }) => { + await authSetup(request, user[permission], password, `${permission}.json`); + }); + } +});