UNPKG

@ordojs/accessibility

Version:

Comprehensive accessibility system for OrdoJS with ARIA generation, automated testing, and screen reader support

170 lines (166 loc) 4.19 kB
import { EventEmitter } from 'events'; import { T as TestingConfig, e as AccessibilityTestResult } from '../index-C9qyHjXw.mjs'; /** * @fileoverview OrdoJS Accessibility - Testing Module * * Automated accessibility testing and auditing. */ /** * Testing manager for handling automated accessibility testing */ declare class TestingManager extends EventEmitter { private config; private testResults; private isInitialized; /** * Create a new TestingManager instance * * @param config - Testing configuration */ constructor(config: TestingConfig); /** * Initialize the testing manager */ initialize(): Promise<void>; /** * Run accessibility tests * * @param url - URL to test * @param options - Test options * @returns Test results */ runTests(url: string, options?: { rules?: string[]; ignoreRules?: string[]; timeout?: number; retries?: number; }): Promise<AccessibilityTestResult[]>; /** * Run specific accessibility test * * @param testName - Test name * @param url - URL to test * @param options - Test options * @returns Test result */ runTest(testName: string, url: string, options?: { timeout?: number; retries?: number; }): Promise<AccessibilityTestResult>; /** * Generate accessibility report * * @param results - Test results * @param options - Report options * @returns Report content */ generateReport(results: AccessibilityTestResult[], options?: { format?: 'json' | 'html' | 'csv'; includePasses?: boolean; includeViolations?: boolean; includeSuggestions?: boolean; }): string; /** * Get test result by ID * * @param testId - Test ID * @returns Test result or undefined */ getTestResult(testId: string): AccessibilityTestResult | undefined; /** * Get all test results * * @returns Array of test results */ getAllTestResults(): AccessibilityTestResult[]; /** * Clear test results */ clearTestResults(): void; /** * Get testing statistics * * @returns Statistics */ getStats(): { totalTests: number; passedTests: number; failedTests: number; averageDuration: number; framework: string; }; /** * Initialize testing framework */ private initializeTestingFramework; /** * Run axe-core tests * * @param url - URL to test * @param rules - Rules to test * @param ignoreRules - Rules to ignore * @param timeout - Test timeout * @returns Test results */ private runAxeCoreTests; /** * Run puppeteer tests * * @param url - URL to test * @param rules - Rules to test * @param ignoreRules - Rules to ignore * @param timeout - Test timeout * @returns Test results */ private runPuppeteerTests; /** * Run JSDOM tests * * @param url - URL to test * @param rules - Rules to test * @param ignoreRules - Rules to ignore * @param timeout - Test timeout * @returns Test results */ private runJSDOMTests; /** * Execute a specific test * * @param testName - Test name * @param url - URL to test * @param timeout - Test timeout * @returns Test result */ private executeTest; /** * Generate JSON report * * @param results - Test results * @param options - Report options * @returns JSON report */ private generateJSONReport; /** * Generate HTML report * * @param results - Test results * @param options - Report options * @returns HTML report */ private generateHTMLReport; /** * Generate CSV report * * @param results - Test results * @param options - Report options * @returns CSV report */ private generateCSVReport; /** * Delay function * * @param ms - Milliseconds to delay */ private delay; } export { TestingManager };