{"id":30176321,"url":"https://github.com/casoon/accessibility-test-cli","last_synced_at":"2025-08-12T02:45:22.125Z","repository":{"id":305158414,"uuid":"1022159307","full_name":"casoon/accessibility-test-cli","owner":"casoon","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-18T20:56:02.000Z","size":742,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-01T15:59:39.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casoon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-18T14:54:39.000Z","updated_at":"2025-07-18T20:56:06.000Z","dependencies_parsed_at":"2025-07-18T17:43:46.619Z","dependency_job_id":"899b11ae-949f-4db9-af96-a7568496763d","html_url":"https://github.com/casoon/accessibility-test-cli","commit_stats":null,"previous_names":["casoon/accessibility-test-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/casoon/accessibility-test-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casoon%2Faccessibility-test-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casoon%2Faccessibility-test-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casoon%2Faccessibility-test-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casoon%2Faccessibility-test-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casoon","download_url":"https://codeload.github.com/casoon/accessibility-test-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casoon%2Faccessibility-test-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269991501,"owners_count":24509009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-12T02:45:20.022Z","updated_at":"2025-08-12T02:45:22.093Z","avatar_url":"https://github.com/casoon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Accessibility Test CLI\n\nA CLI tool for automated accessibility tests based on sitemap URLs.\n\n## 🇩🇪 Barrierefreiheit \u0026 Gesetzeskonformität\n\nDieses Tool unterstützt die Einhaltung des **neuen Barrierefreiheitsgesetzes (BFSG)** und der **EU-Richtlinie 2019/882** für digitale Barrierefreiheit. Es bietet umfassende Tests für statische Websites und ermöglicht die automatisierte Verbesserung der Accessibility-Compliance.\n\n### 🎯 Umfang der Barrierefreiheits-Tests\n\nDas Tool führt **umfassende Accessibility-Audits** durch, die alle wichtigen Aspekte der digitalen Barrierefreiheit abdecken:\n\n#### **Grundlegende Barrierefreiheit (WCAG 2.1 AA)**\n- **Text-Alternativen**: Prüfung von Alt-Attributen für Bilder\n- **Strukturierte Inhalte**: Heading-Hierarchie und semantische HTML-Struktur\n- **Tastaturnavigation**: Vollständige Bedienbarkeit ohne Maus\n- **Fokus-Management**: Sichtbare und logische Fokus-Indikatoren\n- **Farbkontraste**: Mindestkontrastverhältnisse für Text und Hintergrund\n\n#### **Erweiterte Accessibility-Features**\n- **ARIA-Labels**: Korrekte Beschriftung interaktiver Elemente\n- **Formular-Zugänglichkeit**: Labels, Fehlermeldungen und Validierung\n- **Multimedia-Zugänglichkeit**: Untertitel und Transkripte\n- **Responsive Design**: Mobile und Desktop-Kompatibilität\n- **Performance**: Ladezeiten und Core Web Vitals\n\n### 🤖 KI-gestützte Verbesserung für statische Websites\n\nFür **statische Websites** bietet das Tool eine **revolutionäre KI-Integration**:\n\n#### **Detailed Error Report**\n```bash\n# Generiert strukturierte Fehlerberichte für KI-Verarbeitung\na11y-test https://example.com/sitemap.xml --detailed-report\n```\n\n#### **KI-optimierte Ausgabe**\nDer **Detailed Error Report** enthält:\n- **Element-Selektoren**: Präzise CSS-Selectors für problematische Elemente\n- **Kontext-Informationen**: HTML-Kontext für besseres Verständnis\n- **Code-Beispiele**: Korrekte HTML-Strukturen als Vorlagen\n- **Prioritäts-Reihenfolge**: Sortierung nach Wichtigkeit und Fix-Komplexität\n- **Automatisierte Fix-Vorschläge**: Spezifische Empfehlungen für jede Fehlerart\n\n#### **KI-Verarbeitung**\nDer strukturierte Report kann von **KI-Tools** automatisch verarbeitet werden:\n1. **Parsing**: Automatische Erkennung von Fehlertypen und Elementen\n2. **Code-Generierung**: Automatische Erstellung korrigierter HTML/CSS\n3. **Validierung**: Automatische Überprüfung der Korrekturen\n4. **Deployment**: Integration in CI/CD-Pipelines für statische Sites\n\n### 📋 Gesetzeskonformität\n\nDas Tool unterstützt die Einhaltung folgender Standards:\n- **WCAG 2.1 AA**: Internationaler Standard für digitale Barrierefreiheit\n- **WCAG 2.2 AA**: Neueste Accessibility-Richtlinien\n- **Section 508**: US-Bundesstandards für Barrierefreiheit\n- **EU-Richtlinie 2019/882**: Europäische Vorgaben für digitale Barrierefreiheit\n- **BFSG**: Deutsches Barrierefreiheitsgesetz\n\n### 🚀 Vorteile für statische Websites\n\n- **Automatisierte Compliance**: Regelmäßige Tests ohne manuellen Aufwand\n- **KI-gestützte Fixes**: Automatische Verbesserung von Accessibility-Problemen\n- **Dokumentation**: Vollständige Audit-Berichte für Compliance-Nachweise\n- **Skalierbarkeit**: Tests für hunderte von Seiten in Minuten\n- **Integration**: Nahtlose Einbindung in bestehende Workflows\n\n## 🚀 Installation\n\n```bash\n# Install dependencies\nnpm install\n\n# Compile TypeScript\nnpm run build\n\n# (Optional) Install CLI globally\nnpm link\n```\n\n## 📖 Usage\n\n### Simple Command (Recommended)\n\n```bash\n# Test with interactive page selection\na11y-test https://example.com/sitemap.xml\n\n# With custom options (bypasses interactive prompt)\na11y-test https://example.com/sitemap.xml --max-pages 50 --standard WCAG2AAA\n\n# With custom output directory\na11y-test https://example.com/sitemap.xml --output-dir ./my-reports\n\n# Without markdown output (console only)\na11y-test https://example.com/sitemap.xml --no-markdown\n```\n\n### Interactive Mode\n\nWhen you run the command without specifying `--max-pages`, you'll see an interactive dropdown:\n\n```\n🚀 Starting Accessibility Test...\n📄 Sitemap: https://example.com/sitemap.xml\n\n? How many pages would you like to test? (Use arrow keys)\n❯ 20 pages (Comprehensive test)\n  5 pages (Quick test)\n  10 pages (Standard test)\n  50 pages (Full audit)\n  100 pages (Complete analysis)\n  All pages (Maximum coverage)\n\n? Which accessibility standard would you like to test against? (Use arrow keys)\n❯ WCAG 2.0 Level AA (Recommended)\n  WCAG 2.0 Level A (Basic)\n  WCAG 2.0 Level AAA (Strict)\n  Section 508 (US Federal)\n```\n\n**Page Count Options:**\n- **5 pages**: Quick test for basic validation\n- **10 pages**: Standard test for most use cases\n- **20 pages**: Comprehensive test (default)\n- **50 pages**: Full audit for important sites\n- **100 pages**: Complete analysis for large sites\n- **All pages**: Maximum coverage (up to 1000 pages)\n\n**Accessibility Standards:**\n- **WCAG 2.0 Level A**: Basic accessibility requirements\n- **WCAG 2.0 Level AA**: Recommended standard for most websites (default)\n- **WCAG 2.0 Level AAA**: Strictest accessibility requirements\n- **Section 508**: US federal accessibility standards\n\n### Advanced Options\n\n```bash\n# Maximum number of pages to test (bypasses interactive prompt)\na11y-test https://example.com/sitemap.xml --max-pages 10\n\n# Accessibility standard (bypasses interactive prompt)\na11y-test https://example.com/sitemap.xml --standard WCAG2AAA\n\n# Adjust timeout\na11y-test https://example.com/sitemap.xml --timeout 15000\n\n# Verbose output\na11y-test https://example.com/sitemap.xml --verbose\n\n# Filter URL patterns\na11y-test https://example.com/sitemap.xml \\\n  --filter \"demo,test,admin\" \\\n  --include \"blog,services\"\n```\n\n### Advanced Options\n\n```bash\n# Set maximum number of pages to test\na11y-test https://example.com/sitemap.xml --max-pages 10\n\n# Adjust timeout\na11y-test https://example.com/sitemap.xml --timeout 15000\n\n# Verbose output\na11y-test https://example.com/sitemap.xml --verbose\n\n# Filter URL patterns\na11y-test https://example.com/sitemap.xml \\\n  --filter \"demo,test,admin\" \\\n  --include \"blog,services\"\n\n# Use different pa11y standard\na11y-test https://example.com/sitemap.xml --pa11y-standard WCAG2AAA\n\n# Hide specific elements from testing\na11y-test https://example.com/sitemap.xml --hide-elements \"iframe[src*='analytics'], .ads\"\n\n# Include detailed pa11y information\na11y-test https://example.com/sitemap.xml --include-pa11y --include-details\n\n# Custom wait time for dynamic content\na11y-test https://example.com/sitemap.xml --pa11y-wait 2000\n\n# Performance monitoring\na11y-test https://example.com/sitemap.xml --performance-metrics\n\n# Visual testing with screenshots\na11y-test https://example.com/sitemap.xml --screenshots\n\n# Keyboard navigation testing\na11y-test https://example.com/sitemap.xml --keyboard-tests\n\n# Color contrast testing\na11y-test https://example.com/sitemap.xml --color-contrast\n\n# Focus management testing\na11y-test https://example.com/sitemap.xml --focus-management\n\n# Block resources for faster testing\na11y-test https://example.com/sitemap.xml --block-images --block-css\n\n# Mobile emulation\na11y-test https://example.com/sitemap.xml --mobile-emulation\n\n# Custom viewport size\na11y-test https://example.com/sitemap.xml --viewport 1920x1080\n\n# Custom user agent\na11y-test https://example.com/sitemap.xml --user-agent \"Custom-Bot/1.0\"\n```\n\n## ⚙️ Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `-m, --max-pages \u003cnumber\u003e` | Maximum number of pages to test | `5` |\n| `-t, --timeout \u003cnumber\u003e` | Timeout in milliseconds | `10000` |\n| `-w, --wait-until \u003cstring\u003e` | Wait until (domcontentloaded\\|load\\|networkidle) | `domcontentloaded` |\n| `-f, --filter \u003cpatterns\u003e` | Exclude URL patterns (comma-separated) | `[...slug],[category],/demo/` |\n| `-i, --include \u003cpatterns\u003e` | Include URL patterns (comma-separated) | - |\n| `-v, --verbose` | Verbose output | `false` |\n\n\n| `--standard \u003cstandard\u003e` | Accessibility standard (WCAG2A\\|WCAG2AA\\|WCAG2AAA\\|Section508) | `WCAG2AA` |\n| `--output-dir \u003cdir\u003e` | Output directory for markdown file | `./reports` |\n| `--include-details` | Include detailed information in output | `false` |\n| `--include-pa11y` | Include pa11y issues in output | `false` |\n| `--pa11y-standard \u003cstandard\u003e` | Pa11y standard (WCAG2A\\|WCAG2AA\\|WCAG2AAA\\|Section508) | `WCAG2AA` |\n| `--hide-elements \u003cselectors\u003e` | CSS selectors to hide from pa11y tests | - |\n| `--include-notices` | Include pa11y notices in output | `false` |\n| `--include-warnings` | Include pa11y warnings in output | `true` |\n| `--pa11y-wait \u003cms\u003e` | Wait time after page load for pa11y tests | `1000` |\n| `--performance-metrics` | Collect performance metrics | `false` |\n| `--screenshots` | Capture desktop and mobile screenshots | `false` |\n| `--keyboard-tests` | Test keyboard navigation | `false` |\n| `--color-contrast` | Test color contrast (simplified) | `false` |\n| `--focus-management` | Test focus management | `false` |\n| `--block-images` | Block images for faster testing | `false` |\n| `--block-css` | Block CSS for faster testing | `false` |\n| `--mobile-emulation` | Enable mobile emulation | `false` |\n| `--viewport \u003csize\u003e` | Set viewport size (e.g., 1920x1080) | `1920x1080` |\n| `--user-agent \u003cagent\u003e` | Set custom user agent | `a11y-test/1.0` |\n| `--detailed-report` | Generate detailed error report for automated fixes | `false` |\n\n## 🤖 User Agent\n\nThe tool identifies itself as `a11y-test/1.0 (+https://github.com/casoon/accessibility-test-cli)` when accessing websites. This helps website owners understand that the requests are coming from an accessibility testing tool and not a regular browser.\n\nYou can customize the user agent using the `--user-agent` option if needed.\n\n## 🧪 Accessibility Checks\n\nThe tool performs comprehensive accessibility checks using both Playwright and pa11y:\n\n### Playwright Checks\n- **Page Title**: Checks if a title is present\n- **Alt Attributes**: Counts images without alt attribute\n- **Button Labels**: Counts buttons without aria-label\n- **Heading Hierarchy**: Checks if headings are present\n- **Performance Metrics**: Load time, FCP, LCP, and other performance indicators\n- **Keyboard Navigation**: Tests tab order and focusable elements\n- **Color Contrast**: Simplified color contrast analysis\n- **Focus Management**: Checks for proper focus indicators\n- **Screenshots**: Desktop and mobile screenshots for visual testing\n- **Network Optimization**: Block images/CSS for faster testing\n\n### pa11y WCAG Compliance Tests\n- **WCAG 2.0/2.1 Standards**: Full compliance testing (A, AA, AAA levels)\n- **Section 508**: US federal accessibility standards\n- **Detailed Issues**: Specific error codes and recommendations\n- **Context Information**: Element selectors and context for each issue\n- **Impact Assessment**: Issue severity and impact levels\n- **Help Information**: Detailed help text and external resources\n- **Configurable Testing**: Custom selectors, wait times, and standards\n\n## 📊 Output\n\n### Automatic Markdown Output\n\nThe command automatically generates **Markdown output files** with domain-based names:\n\n#### **Markdown (For Humans)**\n```markdown\n# Accessibility Test Report\nGenerated: 2024-01-15T10:30:00.000Z\n\n## Summary\n- **Overall Status**: FAILED\n- **Success Rate**: 90.00%\n- **Score**: 90/100\n- **Critical Issues**: 5\n- **Warnings**: 12\n- **Average Load Time**: 1200ms\n\n## Page Results\n\n| URL | Title | Status | Load Time | Errors | Warnings |\n|-----|-------|--------|-----------|--------|----------|\n| https://example.com/ | Homepage | PASSED | 1200ms | 0 | 2 |\n| https://example.com/about | About | FAILED | 800ms | 1 | 0 |\n\n## Recommendations\n- Fix 5 critical accessibility errors to meet WCAG standards.\n- Address 12 accessibility warnings to improve user experience.\n```\n\n**Filename Format:**\n```\n{domain}-accessibility-report-{YYYY-MM-DD}.md\n```\n\n**Examples:**\n- `example-com-accessibility-report-2024-01-15.md`\n- `mywebsite-de-accessibility-report-2024-01-15.md`\n\n**Benefits:**\n- Automatic domain-based naming\n- Structured reports with tables\n- Summary and recommendations\n- Easy to read and share\n- Perfect for documentation and reports\n\n#### **Detailed Error Report (For Automated Fixes)**\n```bash\n# Generate detailed error report (automatic prompt when errors found)\na11y-test https://example.com/sitemap.xml\n\n# Force detailed error report generation\na11y-test https://example.com/sitemap.xml --detailed-report\n```\n\n**Filename Format:**\n```\n{domain}-detailed-errors-{YYYY-MM-DD}.md\n```\n\n**Features:**\n- **Interactive Prompt**: Automatically asks if you want a detailed report when errors are found\n- **Structured for Automated Processing**: Optimized format for automated tools\n- **Error Categorization**: Grouped by error type (alt attributes, ARIA, contrast, etc.)\n- **Code Examples**: HTML examples for each error type\n- **Recommendations**: Specific fix suggestions for each error\n- **Priority Ordering**: Errors sorted by impact and fix complexity\n- **Context Information**: Element selectors and surrounding context\n- **Processing Instructions**: Step-by-step guide for automated tools\n\n**Example Detailed Report Structure:**\n```markdown\n# Detailed Accessibility Error Report\n\n## Executive Summary\n- Critical Issues: 5 errors requiring immediate attention\n- Pages with Issues: 3 out of 10 tested\n- Success Rate: 70.0%\n\n## Errors Grouped by Type\n\n### Missing Alt Attributes (3 occurrences)\n#### Error 1: Homepage\n- **URL**: https://example.com/\n- **Error**: Images missing alt attributes\n- **Element**: `img.product-image`\n- **Recommendation**: Add descriptive alt text to all images that convey information\n\n### Color Contrast Issues (2 occurrences)\n#### Error 1: About Page\n- **URL**: https://example.com/about\n- **Error**: Insufficient color contrast\n- **Element**: `.text-content`\n- **Recommendation**: Increase color contrast ratio to at least 4.5:1\n\n## Processing Instructions\n1. Parse each error using the structured format above\n2. Identify the element using the provided selector\n3. Apply the recommended fix based on the error type\n4. Test the fix to ensure it resolves the issue\n5. Update the code with the corrected version\n```\n\n### Interactive Detailed Report Generation\n\nWhen accessibility errors are found, the tool automatically prompts you to generate a detailed report:\n\n```\n✅ Test completed successfully!\n📊 Results:\n   - Pages tested: 5\n   - Passed: 3\n   - Failed: 2\n   - Errors: 8\n   - Warnings: 12\n   - Success rate: 60.0%\n📄 Markdown report: ./reports/example-com-accessibility-report-2024-01-15.md\n\n🔍 8 accessibility errors found.\n\n? Would you like to generate a detailed error report for automated fixes? (Y/n)\n```\n\n### Console Output\n```\n🎯 Accessibility Test Summary\n──────────────────────────────────────────────────\n📄 Total pages: 113\n🧪 Pages tested: 5\n✅ Passed: 4\n❌ Failed: 1\n⚠️  Warnings: 3\n⏱️  Total duration: 2345ms\n```\n\n### Verbose Output (--verbose)\n```\n📋 Detailed Results:\n✅ https://example.com/\n   Title: Homepage\n   Duration: 456ms\n   ⚠️  2 buttons without aria-label\n\n❌ https://example.com/error-page\n   Title: Error Page\n   Duration: 123ms\n   ❌ No headings found\n```\n\n## 🔧 Development\n\n```bash\n# Start development server\nnpm run dev\n\n# Compile TypeScript\nnpm run build\n\n# Format code\nnpm run format\n\n# Linting\nnpm run lint\n```\n\n## 📁 Project Structure\n\n```\naccessibility-test-cli/\n├── src/\n│   ├── index.ts              # Main entry point\n│   ├── sitemap-parser.ts     # Sitemap parsing logic\n│   ├── accessibility-checker.ts # Playwright tests\n│   └── types.ts              # TypeScript types\n├── bin/\n│   └── a11y-test.js          # CLI entry point\n├── dist/                     # Compiled files\n└── package.json\n```\n\n## 🤝 Contributing\n\n1. Create a fork\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push the branch (`git push origin feature/amazing-feature`)\n5. Create a pull request\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasoon%2Faccessibility-test-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasoon%2Faccessibility-test-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasoon%2Faccessibility-test-cli/lists"}