@casoon/auditmysite
Version:
A comprehensive command-line tool for automated accessibility, security, performance, and SEO testing using Playwright and pa11y, based on sitemap URLs
117 lines • 3.18 kB
TypeScript
export interface Pa11yIssue {
code: string;
message: string;
type: 'error' | 'warning' | 'notice';
selector?: string;
context?: string;
impact?: string;
help?: string;
helpUrl?: string;
}
export interface AccessibilityResult {
url: string;
title: string;
imagesWithoutAlt: number;
buttonsWithoutLabel: number;
headingsCount: number;
errors: string[];
warnings: string[];
passed: boolean;
duration: number;
pa11yIssues?: Pa11yIssue[];
pa11yScore?: number;
performanceMetrics?: {
loadTime: number;
domContentLoaded: number;
firstPaint: number;
firstContentfulPaint: number;
largestContentfulPaint: number;
};
keyboardNavigation?: string[];
colorContrastIssues?: string[];
focusManagementIssues?: string[];
screenshots?: {
desktop?: string;
mobile?: string;
};
consoleErrors?: string[];
networkErrors?: string[];
lighthouseScores?: LighthouseScores;
lighthouseMetrics?: LighthouseMetrics;
}
export interface TestOptions {
maxPages?: number;
timeout?: number;
waitUntil?: "domcontentloaded" | "load" | "networkidle";
filterPatterns?: string[];
includePatterns?: string[];
verbose?: boolean;
output?: "console" | "json" | "html";
outputFile?: string;
pa11yStandard?: 'WCAG2A' | 'WCAG2AA' | 'WCAG2AAA' | 'Section508';
hideElements?: string;
includeNotices?: boolean;
includeWarnings?: boolean;
includePasses?: boolean;
runners?: string[];
wait?: number;
chromeLaunchConfig?: any;
captureScreenshots?: boolean;
testKeyboardNavigation?: boolean;
testColorContrast?: boolean;
testFocusManagement?: boolean;
collectPerformanceMetrics?: boolean;
blockImages?: boolean;
blockCSS?: boolean;
mobileEmulation?: boolean;
viewportSize?: {
width: number;
height: number;
};
userAgent?: string;
maxConcurrent?: number;
maxRetries?: number;
retryDelay?: number;
enableProgressBar?: boolean;
progressUpdateInterval?: number;
enableResourceMonitoring?: boolean;
maxMemoryUsage?: number;
maxCpuUsage?: number;
useParallelTesting?: boolean;
useSequentialTesting?: boolean;
outputFormat?: 'markdown' | 'html';
includeCopyButtons?: boolean;
usePa11y?: boolean;
lighthouse?: boolean;
}
export interface LighthouseScores {
performance: number;
accessibility: number;
bestPractices: number;
seo: number;
}
export interface LighthouseMetrics {
firstContentfulPaint: number;
largestContentfulPaint: number;
firstInputDelay: number;
cumulativeLayoutShift: number;
totalBlockingTime: number;
speedIndex: number;
}
export interface SitemapUrl {
loc: string;
lastmod?: string;
changefreq?: string;
priority?: number;
}
export interface TestSummary {
totalPages: number;
testedPages: number;
passedPages: number;
failedPages: number;
totalErrors: number;
totalWarnings: number;
totalDuration: number;
results: AccessibilityResult[];
}
//# sourceMappingURL=types.d.ts.map