chore: Implement authentication fixes for TestDataManager and update user management tests

- Refactored TestDataManager to use authenticated context with Playwright's newContext method.
- Updated auth-fixtures to ensure proper authentication state is inherited for API requests.
- Created constants.ts to avoid circular imports and manage shared constants.
- Fixed critical bug in auth setup that caused E2E tests to fail due to improper imports.
- Re-enabled user management tests with updated selectors and added comments regarding current issues.
- Documented environment configuration issues causing cookie domain mismatches in skipped tests.
- Generated QA report detailing test results and recommendations for further action.
This commit is contained in:
GitHub Actions
2026-01-22 15:28:14 +00:00
parent 4a0b095ebf
commit 6593aca0ed
8 changed files with 607 additions and 4422 deletions

View File

@@ -1,6 +1,5 @@
import { test as setup, expect } from '@bgotink/playwright-coverage';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { STORAGE_STATE } from './constants';
/**
* Authentication Setup for E2E Tests
@@ -20,9 +19,8 @@ const TEST_EMAIL = process.env.E2E_TEST_EMAIL || 'e2e-test@example.com';
const TEST_PASSWORD = process.env.E2E_TEST_PASSWORD || 'TestPassword123!';
const TEST_NAME = process.env.E2E_TEST_NAME || 'E2E Test User';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export const STORAGE_STATE = join(__dirname, '../playwright/.auth/user.json');
// Re-export STORAGE_STATE for backwards compatibility with playwright.config.js
export { STORAGE_STATE };
setup('authenticate', async ({ request, baseURL }) => {
// Step 1: Check if setup is required