fix: resolve all lint errors in e2e tests and improve type safety

- Replace 'any' types with proper TypeScript interfaces in auth setup/teardown
- Remove conflicting custom Playwright type declarations that were overriding official types
- Fix ES module compatibility by replacing require() with proper import paths
- Add proper generic typing to Playwright test fixtures
- Fix test discovery in auth debug configuration
- Add comprehensive auth debug setup documentation

Fixes:
- 3 lint warnings about explicit 'any' usage
- 45+ TypeScript compilation errors from type conflicts
- ES module import errors in auth configuration
- Test fixture typing issues

All e2e tests now pass lint and type checking with zero warnings.
This commit is contained in:
William Valentin
2025-09-08 08:47:21 -07:00
parent 4d12aeef61
commit a1b3c6a8ed
6 changed files with 533 additions and 127 deletions

View File

@@ -1,11 +1,29 @@
/* eslint-disable no-console */
import { FullConfig } from '@playwright/test';
interface GlobalTeardownConfig {
projects?: Array<{
name: string;
use?: Record<string, unknown>;
}>;
webServer?: Array<{
command: string;
port: number;
timeout: number;
reuseExistingServer: boolean;
}>;
use?: {
baseURL?: string;
trace?: string;
screenshot?: string;
};
[key: string]: unknown;
}
/**
* Global teardown for authentication debug tests
* Cleans up test environment and generates summary report
*/
async function globalTeardown(_config: FullConfig) {
async function globalTeardown(_config: GlobalTeardownConfig) {
console.log('🧹 Starting authentication debug test teardown...');
const startTime = Date.now();
@@ -375,7 +393,7 @@ async function emergencyCleanup(): Promise<void> {
}
// Execute teardown
export default async function (config: FullConfig) {
export default async function (config: GlobalTeardownConfig) {
try {
await globalTeardown(config);
} catch (_error) {