iaccessibility-test-app
v1.0.19
Published
<p align="center"> <img src="https://img.shields.io/npm/v/iaccessibility.svg?style=flat-square" alt="npm version"> <img src="https://img.shields.io/npm/dt/iaccessibility.svg?style=flat-square" alt="npm downloads"> <img src="https://img.shields.io
Readme
🧩 iAccessibility
📚 Table of Contents
🚀 Getting Started
🧠 Installation
Install iAccessibility locally:
npm install iaccessibilityOr install globally:
npm install -g iaccessibility⚙️ Initialization
Initialize iAccessibility in your project:
npm run iaccessibility:initThis will set up configuration and supporting files.
▶️ Execution
1️⃣ Run Using Sitemap
Run accessibility checks using a sitemap:
npm run iaccessibility2️⃣ Run Using Manual URLs
Pass URLs directly (comma-separated):
npm run iaccessibility --urls=https://example.com,https://example2.com📊 Reports
Generate a detailed accessibility report:
npm run iaccessibility --reportGenerate a report and display results in the terminal:
npm run iaccessibility --report --outputReports are saved as .xlsx files for easy sharing and tracking.
🧹 Uninstallation
To remove iAccessibility or its configuration, run:
npm run iaccessibility:initThen choose the appropriate uninstall option.
⚙️ Configuration
You can manually adjust settings in the iAccessibilityConfig.json file.
| Property | Description | Default |
|-----------|--------------|----------|
| reportFileName | Name of generated report file | AccessibilityReport.xlsx |
| reportDir | Directory for reports | reports |
| sitemapPath | Path to sitemap file | ./ |
| tag | Accessibility rule tag filter | best-practices |
🧩 Axe Configuration
Configure scan behavior and browser settings:
{
"timeout": 60000,
"headless": true,
"cookies": [],
"extraHTTPHeaders": {},
"localStorageData": {},
"sessionStorageData": {},
"auth": { "url": "", "payload": {} },
"batchSize": 10,
"autoTraverse": false,
"autoTraverseDepth": 1
}Option Descriptions
timeout: Page timeout in millisecondsheadless: Run in headless browser modecookies: Set cookies for authenticated pagesextraHTTPHeaders: Inject custom HTTP headerslocalStorageData/sessionStorageData: Set page storage dataauth: API call before scan (for authentication)batchSize: Number of pages to scan concurrentlyautoTraverse: Auto-follow and scan internal linksautoTraverseDepth: Depth for link traversal (-1for infinite)
🍪 Cookies Format
Example format for cookies:
[
{
"name": "token",
"value": "abc123",
"url": "https://example.com",
"domain": ".example.com",
"path": "/",
"expires": 1734567890,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
}
]Notes:
- Either
urlordomain/pathmust be provided.- Prefix domain with a dot (
.example.com) to apply cookies across subdomains.
📜 iAccessibilityScript File Uses
The iAccessibilityScript file enables you to inject custom JavaScript logic into the accessibility scanning process.
It provides three lifecycle modules — Global, PreLoad, and PostRender — that give fine-grained control over how pages are analyzed.
🧱 Available Modules
| Module | Execution Phase | Description | |---------|------------------|-------------| | Global | Executes once before loading any page into the browser. | Use this module to define global utilities, or functions that can be accessed for all the pages. | | PreLoad | Executes before each page is loaded. | Use this module to define utilities, or functions that can be accessed for each page. | | PostRender | Executes after the page has fully rendered. | Perfect for DOM manipulations, simulating user interactions, or preparing the page before Axe accessibility checks are run. |
🧠 Summary
iAccessibility simplifies the process of identifying, managing, and reporting accessibility violations in web projects.
It’s flexible, easy to configure, and supports both sitemap-based and manual URL scanning — making it a must-have for web accessibility audits.
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
