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:
82
types/playwright.d.ts
vendored
82
types/playwright.d.ts
vendored
@@ -1,82 +0,0 @@
|
||||
// Temporary type declarations for Playwright
|
||||
// This file can be removed once @playwright/test is properly installed
|
||||
|
||||
declare module '@playwright/test' {
|
||||
export interface Page {
|
||||
goto(url: string): Promise<void>;
|
||||
click(selector: string): Promise<void>;
|
||||
fill(selector: string, value: string): Promise<void>;
|
||||
selectOption(selector: string, value: string): Promise<void>;
|
||||
locator(selector: string): Locator;
|
||||
waitForSelector(
|
||||
selector: string,
|
||||
options?: { timeout?: number }
|
||||
): Promise<void>;
|
||||
setViewportSize(size: { width: number; height: number }): Promise<void>;
|
||||
}
|
||||
|
||||
export interface Locator {
|
||||
click(): Promise<void>;
|
||||
fill(value: string): Promise<void>;
|
||||
toBeVisible(): Promise<void>;
|
||||
toContainText(text: string | string[]): Promise<void>;
|
||||
toHaveClass(pattern: RegExp): Promise<void>;
|
||||
not: Locator;
|
||||
first(): Locator;
|
||||
toHaveCount(count: number): Promise<void>;
|
||||
}
|
||||
|
||||
export interface TestFunction {
|
||||
(name: string, fn: ({ page }: { page: Page }) => Promise<void>): void;
|
||||
describe: (name: string, fn: () => void) => void;
|
||||
beforeEach: (fn: ({ page }: { page: Page }) => Promise<void>) => void;
|
||||
extend: (fixtures: Record<string, unknown>) => TestFunction;
|
||||
}
|
||||
|
||||
export interface ExpectFunction {
|
||||
(actual: unknown): {
|
||||
toBeVisible(): Promise<void>;
|
||||
toContainText(text: string | string[]): Promise<void>;
|
||||
toHaveClass(pattern: RegExp): Promise<void>;
|
||||
not: {
|
||||
toBeVisible(): Promise<void>;
|
||||
toHaveClass(pattern: RegExp): Promise<void>;
|
||||
};
|
||||
toHaveCount(count: number): Promise<void>;
|
||||
};
|
||||
}
|
||||
|
||||
export const test: TestFunction;
|
||||
export const expect: ExpectFunction;
|
||||
|
||||
export interface Config {
|
||||
testDir?: string;
|
||||
fullyParallel?: boolean;
|
||||
forbidOnly?: boolean;
|
||||
retries?: number;
|
||||
workers?: number;
|
||||
reporter?: string;
|
||||
use?: {
|
||||
baseURL?: string;
|
||||
trace?: string;
|
||||
screenshot?: string;
|
||||
video?: string;
|
||||
};
|
||||
projects?: Array<{
|
||||
name: string;
|
||||
use: Record<string, unknown>;
|
||||
}>;
|
||||
webServer?: {
|
||||
command: string;
|
||||
url: string;
|
||||
reuseExistingServer: boolean;
|
||||
timeout: number;
|
||||
};
|
||||
}
|
||||
|
||||
export function defineConfig(config: Config): Config;
|
||||
|
||||
export const devices: {
|
||||
[key: string]: Record<string, unknown>;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user