- Add comprehensive TypeScript types to E2E test helpers - Improve medication, auth, modal, and wait helper classes with proper typing - Enhance test data with readonly type assertions for better immutability - Update integration tests with better error handling and assertions - Improve Playwright type definitions for better IDE support - Add environment variable support to manual test scripts
83 lines
2.3 KiB
TypeScript
83 lines
2.3 KiB
TypeScript
// 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>;
|
|
};
|
|
}
|