Some workout management tests fixed with Antigravity

This commit is contained in:
AG
2025-12-08 16:17:13 +02:00
parent 615c3a0cb7
commit d2dc474f0f
7 changed files with 363 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ import { request } from '@playwright/test';
// Define the type for our custom fixtures
type MyFixtures = {
createUniqueUser: () => Promise<{ email: string, password: string, id: string }>;
createUniqueUser: () => Promise<{ email: string, password: string, id: string, token: string }>;
};
// Extend the base test with our custom fixture
@@ -13,7 +13,7 @@ export const test = base.extend<MyFixtures>({
// We use a new API context for setup to avoid polluting request history,
// although setup requests are usually separate anyway.
const apiContext = await request.newContext({
baseURL: 'http://localhost:3001' // Direct access to backend
baseURL: 'http://127.0.0.1:3001' // Direct access to backend
});
// Setup: Helper function to create a user
@@ -38,7 +38,7 @@ export const test = base.extend<MyFixtures>({
throw new Error(`Failed to register user: ${JSON.stringify(body)}`);
}
return { email, password, id: body.user.id };
return { email, password, id: body.user.id, token: body.token };
};
// Use the fixture