UNPKG

@ordojs/core

Version:

Core compiler and runtime for OrdoJS framework

103 lines 3 kB
/** * @fileoverview Integration Testing Utilities for OrdoJS Framework */ import { ServerMockUtils } from './server-mock.js'; import { OrdoJSTestFramework } from './test-framework.js'; import type { IntegrationTestConfig, IntegrationTestResult, ServerMockConfig } from './types.js'; /** * Integration testing utilities for full-stack OrdoJS applications */ export declare class IntegrationTestUtils { private testFramework; private serverMockUtils; private jsdomInstance?; private currentEnvironment?; private testDatabaseConfig?; private serverConfig?; constructor(); /** * Set up integration test environment */ setupTestEnvironment(config: IntegrationTestConfig): Promise<void>; /** * Set up test database */ private setupTestDatabase; /** * Set up test server */ private setupTestServer; /** * Clean up test environment */ teardownTestEnvironment(): Promise<void>; /** * Clean up test database */ private teardownTestDatabase; /** * Clean up test server */ private teardownTestServer; /** * Run integration test */ runIntegrationTest(testFn: () => Promise<void>, config: IntegrationTestConfig): Promise<IntegrationTestResult>; /** * Run multiple integration tests */ runIntegrationTests(tests: Array<{ name: string; testFn: () => Promise<void>; config?: Partial<IntegrationTestConfig>; }>, baseConfig: IntegrationTestConfig): Promise<IntegrationTestResult[]>; /** * Get test framework instance */ getTestFramework(): OrdoJSTestFramework; /** * Get server mock utils instance */ getServerMockUtils(): ServerMockUtils; /** * Create a mock server function */ mockServerFunction(functionName: string, implementation: (...args: any[]) => any | Promise<any>, config?: Partial<ServerMockConfig>): void; /** * Navigate to a URL in the JSDOM environment */ navigateTo(url: string): Promise<void>; /** * Wait for an element to appear in the DOM */ waitForElement(selector: string, timeout?: number): Promise<Element>; /** * Wait for a condition to be true */ waitForCondition(condition: () => boolean | Promise<boolean>, timeout?: number, interval?: number): Promise<void>; /** * Fill a form field */ fillFormField(selector: string, value: string): Promise<void>; /** * Click an element */ clickElement(selector: string): Promise<void>; /** * Get element text content */ getElementText(selector: string): string; /** * Get element attribute */ getElementAttribute(selector: string, attribute: string): string | null; /** * Check if element exists */ elementExists(selector: string): boolean; /** * Get current URL */ getCurrentUrl(): string; } //# sourceMappingURL=integration-test.d.ts.map