test: enhance E2E and integration testing infrastructure

- 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
This commit is contained in:
William Valentin
2025-09-07 15:22:33 -07:00
parent 172bb2bd74
commit b4a9318324
6 changed files with 152 additions and 100 deletions

View File

@@ -30,11 +30,11 @@ declare module '@playwright/test' {
(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: any) => TestFunction;
extend: (fixtures: Record<string, unknown>) => TestFunction;
}
export interface ExpectFunction {
(actual: any): {
(actual: unknown): {
toBeVisible(): Promise<void>;
toContainText(text: string | string[]): Promise<void>;
toHaveClass(pattern: RegExp): Promise<void>;
@@ -64,7 +64,7 @@ declare module '@playwright/test' {
};
projects?: Array<{
name: string;
use: any;
use: Record<string, unknown>;
}>;
webServer?: {
command: string;
@@ -77,6 +77,6 @@ declare module '@playwright/test' {
export function defineConfig(config: Config): Config;
export const devices: {
[key: string]: any;
[key: string]: Record<string, unknown>;
};
}