@casoon/auditmysite
Version:
A comprehensive command-line tool for automated accessibility, security, performance, and SEO testing using Playwright and pa11y, based on sitemap URLs
154 lines (121 loc) β’ 5.39 kB
Markdown
# Accessibility Test CLI - Source Structure
This documentation describes the new structured folder organization of the Accessibility Test CLI.
## π Ordnerstruktur
```
src/
βββ index.ts # Haupt-Einstiegspunkt
βββ types.ts # TypeScript Typen und Interfaces
βββ README.md # Diese Dokumentation
βββ core/ # Kern-FunktionalitΓ€t
β βββ index.ts # Core-Module Export
β βββ accessibility-checker.ts
β βββ standard-pipeline.ts
βββ parsers/ # Parser fΓΌr verschiedene Datenquellen
β βββ index.ts # Parser-Module Export
β βββ sitemap-parser.ts
βββ generators/ # Output-Generatoren
β βββ index.ts # Generator-Module Export
β βββ output-generator.ts
βββ reports/ # Report-Generatoren
β βββ index.ts # Report-Module Export
β βββ detailed-report.ts
βββ tests/ # Accessibility-Test-Suite
βββ index.ts # Test-Module Export
βββ base-test.ts # Basis-Test-Klasse
βββ test-manager.ts # Test-Manager
βββ README.md # Test-Dokumentation
βββ form/ # Formular-Tests
βββ keyboard/ # Keyboard Navigation Tests
βββ aria/ # ARIA Tests
βββ semantic/ # Semantic HTML Tests
βββ media/ # Media Accessibility Tests
βββ language/ # Language & i18n Tests (geplant)
βββ performance/ # Performance Tests (geplant)
βββ validation/ # Validation Tests (geplant)
```
## ποΈ Module Organization
### **Core Module** (`src/core/`)
Core functionality for accessibility testing:
- **AccessibilityChecker**: Main test engine with Playwright and pa11y
- **StandardPipeline**: Standardized test pipeline for automated execution
### **Parsers** (`src/parsers/`)
Parsers for different data sources:
- **SitemapParser**: XML sitemap parser with URL filtering and conversion
### **Generators** (`src/generators/`)
Output generators for different formats:
- **OutputGenerator**: Markdown, JSON, CSV, HTML output generation
### **Reports** (`src/reports/`)
Specialized report generators:
- **DetailedReportGenerator**: AI-optimized detailed error reports
### **Tests** (`src/tests/`)
Modular accessibility test suite:
- **BaseAccessibilityTest**: Base class for all tests
- **TestManager**: Coordination and execution of tests
- Categorized tests (form, keyboard, aria, semantic, media)
## π Import Structure
### **Index Files**
Each folder has an `index.ts` file that exports all modules:
```typescript
// src/core/index.ts
export { AccessibilityChecker } from './accessibility-checker';
export { StandardPipeline } from './standard-pipeline';
// src/parsers/index.ts
export { SitemapParser } from './sitemap-parser';
// src/generators/index.ts
export { OutputGenerator } from './output-generator';
// src/reports/index.ts
export { DetailedReportGenerator } from './detailed-report';
```
### **Import Examples**
```typescript
// From core
import { AccessibilityChecker, StandardPipeline } from './core';
// From parsers
import { SitemapParser } from './parsers';
// From generators
import { OutputGenerator } from './generators';
// From reports
import { DetailedReportGenerator } from './reports';
// From tests
import { TestManager, FormLabelTest } from './tests';
```
## π― Benefits of the New Structure
### **Organization**
- β
**Logical Grouping**: Similar functionality is grouped together
- β
**Clear Responsibilities**: Each folder has a specific purpose
- β
**Easy Navigation**: Intuitive folder structure
### **Maintainability**
- β
**Modular Architecture**: Individual modules can be changed independently
- β
**Index Files**: Central export points for easy imports
- β
**Clear Dependencies**: Import paths show relationships
### **Extensibility**
- β
**New Parsers**: Easy to add in `parsers/`
- β
**New Generators**: Easy to add in `generators/`
- β
**New Tests**: Easy to add in `tests/`
- β
**New Reports**: Easy to add in `reports/`
### **Testability**
- β
**Isolated Modules**: Each module can be tested independently
- β
**Clear Interfaces**: Index files define public APIs
- β
**Structured Tests**: Test suite is self-organized
## π Migration
The migration to the new structure was seamless:
1. **Files moved** to appropriate folders
2. **Index files created** for easy imports
3. **Import paths updated** in all files
4. **CLI paths adjusted** for the new structure
## π Next Steps
The new structure enables easy extensions:
1. **New Parsers**: RSS, JSON, CSV parsers in `parsers/`
2. **New Generators**: PDF, Excel generators in `generators/`
3. **New Reports**: Compliance reports in `reports/`
4. **New Tests**: Color contrast, language tests in `tests/`
## π§ Development
### **Adding a New Module**
1. Create file in the appropriate folder
2. Export in `index.ts`
3. Import in other modules
### **Adding a New Test**
1. Create test class in appropriate `tests/` subfolder
2. Inherit from `BaseAccessibilityTest`
3. Register in `TestManager`
4. Export in `tests/index.ts`