@dallask/a11y-mcp-srv 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +9 -0
- package/README.md +1328 -0
- package/bin/server.js +8 -0
- package/dist/core/accessibility-runner.d.ts +123 -0
- package/dist/core/accessibility-runner.d.ts.map +1 -0
- package/dist/core/accessibility-runner.js +465 -0
- package/dist/core/accessibility-runner.js.map +1 -0
- package/dist/core/basic-auth.d.ts +35 -0
- package/dist/core/basic-auth.d.ts.map +1 -0
- package/dist/core/basic-auth.js +52 -0
- package/dist/core/basic-auth.js.map +1 -0
- package/dist/core/config.d.ts +44 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +163 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/error-handler.d.ts +66 -0
- package/dist/core/error-handler.d.ts.map +1 -0
- package/dist/core/error-handler.js +305 -0
- package/dist/core/error-handler.js.map +1 -0
- package/dist/core/normalize-audit-result.d.ts +18 -0
- package/dist/core/normalize-audit-result.d.ts.map +1 -0
- package/dist/core/normalize-audit-result.js +118 -0
- package/dist/core/normalize-audit-result.js.map +1 -0
- package/dist/core/playwright-bootstrap.d.ts +21 -0
- package/dist/core/playwright-bootstrap.d.ts.map +1 -0
- package/dist/core/playwright-bootstrap.js +144 -0
- package/dist/core/playwright-bootstrap.js.map +1 -0
- package/dist/core/progress-streamer.d.ts +44 -0
- package/dist/core/progress-streamer.d.ts.map +1 -0
- package/dist/core/progress-streamer.js +160 -0
- package/dist/core/progress-streamer.js.map +1 -0
- package/dist/core/result-processor.d.ts +86 -0
- package/dist/core/result-processor.d.ts.map +1 -0
- package/dist/core/result-processor.js +475 -0
- package/dist/core/result-processor.js.map +1 -0
- package/dist/core/session-manager.d.ts +73 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +243 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1439 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/aggregate.d.ts +26 -0
- package/dist/tools/aggregate.d.ts.map +1 -0
- package/dist/tools/aggregate.js +340 -0
- package/dist/tools/aggregate.js.map +1 -0
- package/dist/tools/analysis.d.ts +68 -0
- package/dist/tools/analysis.d.ts.map +1 -0
- package/dist/tools/analysis.js +1199 -0
- package/dist/tools/analysis.js.map +1 -0
- package/dist/tools/audit.d.ts +38 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +472 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/comparison.d.ts +27 -0
- package/dist/tools/comparison.d.ts.map +1 -0
- package/dist/tools/comparison.js +499 -0
- package/dist/tools/comparison.js.map +1 -0
- package/dist/tools/export.d.ts +43 -0
- package/dist/tools/export.d.ts.map +1 -0
- package/dist/tools/export.js +746 -0
- package/dist/tools/export.js.map +1 -0
- package/dist/tools/filter.d.ts +26 -0
- package/dist/tools/filter.d.ts.map +1 -0
- package/dist/tools/filter.js +244 -0
- package/dist/tools/filter.js.map +1 -0
- package/dist/tools/session.d.ts +26 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +228 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/visualize.d.ts +26 -0
- package/dist/tools/visualize.d.ts.map +1 -0
- package/dist/tools/visualize.js +942 -0
- package/dist/tools/visualize.js.map +1 -0
- package/dist/types/index.d.ts +792 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +69 -0
package/bin/server.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AccessibilityRunner - Runs accessibility tests using axe-core or IBM Equal Access (ACE)
|
|
3
|
+
* Replaces previous WAVE-based implementation with axe-core and accessibility-checker.
|
|
4
|
+
*/
|
|
5
|
+
import { type Page } from 'playwright';
|
|
6
|
+
import type { AccessibilityResults, AccessibilityTag, AccessibilityEngine, WaitStrategy } from '../types/index.js';
|
|
7
|
+
/** Re-export for callers that use runner config */
|
|
8
|
+
export type { AccessibilityEngine } from '../types/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for running an accessibility test
|
|
11
|
+
*/
|
|
12
|
+
export interface AccessibilityRunnerConfig {
|
|
13
|
+
/** URL to test */
|
|
14
|
+
url: string;
|
|
15
|
+
/** Wait strategy for page loading */
|
|
16
|
+
waitForLoad?: WaitStrategy;
|
|
17
|
+
/** Timeout in milliseconds (default: 30000) */
|
|
18
|
+
timeout?: number;
|
|
19
|
+
/** Accessibility tags to pass to the engine as runOnly scope */
|
|
20
|
+
tags?: AccessibilityTag[];
|
|
21
|
+
/** Engine to use: axe-core (default) or IBM Equal Access */
|
|
22
|
+
engine?: AccessibilityEngine;
|
|
23
|
+
/** Whether to post-filter results by tags (default: false).
|
|
24
|
+
* Set to true only when the user explicitly requested specific tags.
|
|
25
|
+
* When false, tags are passed to the engine for scoping but all returned issues are shown. */
|
|
26
|
+
applyTagFilter?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Result from running an accessibility test
|
|
30
|
+
*/
|
|
31
|
+
export interface AccessibilityRunnerResult {
|
|
32
|
+
/** Raw accessibility results */
|
|
33
|
+
accessibilityResults: AccessibilityResults;
|
|
34
|
+
/** Filtered results if tags were specified */
|
|
35
|
+
filteredResults?: AccessibilityResults;
|
|
36
|
+
/** Applied filters information */
|
|
37
|
+
appliedFilters?: {
|
|
38
|
+
tags?: AccessibilityTag[];
|
|
39
|
+
originalIssueCount?: number;
|
|
40
|
+
};
|
|
41
|
+
/** HTTP status code of the main document response (e.g. 200, 401). Undefined when no navigation. */
|
|
42
|
+
responseStatus?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* AccessibilityRunner class - Handles accessibility test execution with axe-core or ACE
|
|
46
|
+
*/
|
|
47
|
+
export declare class AccessibilityRunner {
|
|
48
|
+
private axePath;
|
|
49
|
+
constructor();
|
|
50
|
+
/**
|
|
51
|
+
* Navigate to URL and wait for page to be ready.
|
|
52
|
+
* @returns HTTP status code of the main document response (e.g. 200, 401), or undefined if unavailable.
|
|
53
|
+
*/
|
|
54
|
+
private navigateAndWait;
|
|
55
|
+
/**
|
|
56
|
+
* Build axe run options (runOnly tags)
|
|
57
|
+
*/
|
|
58
|
+
private buildAxeOptions;
|
|
59
|
+
/**
|
|
60
|
+
* Run axe-core analysis in the browser and return raw axe result
|
|
61
|
+
*/
|
|
62
|
+
private runAxeAnalysis;
|
|
63
|
+
/**
|
|
64
|
+
* Convert axe-core results to our AccessibilityResults format
|
|
65
|
+
*/
|
|
66
|
+
private axeToAccessibilityResults;
|
|
67
|
+
/**
|
|
68
|
+
* Map axe-style WCAG tags to IBM Equal Access policy IDs.
|
|
69
|
+
* ACE is scoped at scan time via setConfig({ policies }) — not post-filtered.
|
|
70
|
+
* wcag22* → WCAG_2_2
|
|
71
|
+
* wcag21* → WCAG_2_1
|
|
72
|
+
* wcag2* → WCAG_2_0
|
|
73
|
+
* best-practice / (default) → IBM_Accessibility
|
|
74
|
+
*/
|
|
75
|
+
private acePolicesFromTags;
|
|
76
|
+
/**
|
|
77
|
+
* Run IBM Equal Access (accessibility-checker) analysis on HTML content.
|
|
78
|
+
* ACE never fetches URLs; the caller loads the page in Playwright and passes the final HTML
|
|
79
|
+
* (including everything changed by JavaScript). This avoids ACE's internal Puppeteer launch.
|
|
80
|
+
* WCAG level/policy is configured via setConfig before the scan — tags are engine settings.
|
|
81
|
+
*/
|
|
82
|
+
private runACEAnalysis;
|
|
83
|
+
/**
|
|
84
|
+
* Compare impact severity (higher = worse). Used to take the worst impact per rule.
|
|
85
|
+
* Uses IMPACT_ORDER for both axe and ACE native levels.
|
|
86
|
+
*/
|
|
87
|
+
private impactRank;
|
|
88
|
+
/**
|
|
89
|
+
* Convert ACE report to our AccessibilityResults format.
|
|
90
|
+
* Uses ACE native levels (violation, potentialviolation, recommendation, etc.).
|
|
91
|
+
*/
|
|
92
|
+
private aceToAccessibilityResults;
|
|
93
|
+
/**
|
|
94
|
+
* Run accessibility analysis (axe in browser, or ACE via getCompliance)
|
|
95
|
+
*/
|
|
96
|
+
private runAccessibilityAnalysis;
|
|
97
|
+
/**
|
|
98
|
+
* Count total issues in violations
|
|
99
|
+
*/
|
|
100
|
+
private countTotalIssues;
|
|
101
|
+
/**
|
|
102
|
+
* Get a mapping of common accessibility rule IDs to their accessibility tags.
|
|
103
|
+
* Includes both axe-core and ACE-style rule IDs; WCAG 2.2 tags ensure strict
|
|
104
|
+
* tag filters (e.g. wcag22aa only) still include these rules.
|
|
105
|
+
*/
|
|
106
|
+
private getRuleTagMapping;
|
|
107
|
+
/**
|
|
108
|
+
* Check if a rule matches any of the specified tags.
|
|
109
|
+
* Only uses ruleData.tags when the array is non-empty; otherwise falls back to
|
|
110
|
+
* the static mapping and finally defaults to true (include the rule).
|
|
111
|
+
* This prevents rules with tags:[] from being silently dropped.
|
|
112
|
+
*/
|
|
113
|
+
private ruleMatchesTags;
|
|
114
|
+
/**
|
|
115
|
+
* Filter accessibility results by tags
|
|
116
|
+
*/
|
|
117
|
+
private filterByTags;
|
|
118
|
+
/**
|
|
119
|
+
* Run accessibility test on a URL
|
|
120
|
+
*/
|
|
121
|
+
run(page: Page, config: AccessibilityRunnerConfig): Promise<AccessibilityRunnerResult>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=accessibility-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility-runner.d.ts","sourceRoot":"","sources":["../../src/core/accessibility-runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAGtC,OAAO,KAAK,EACV,oBAAoB,EAIpB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACb,MAAM,mBAAmB,CAAA;AAW1B,mDAA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G;IACH,OAAO,CAAC,eAAe;IAiBvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAiCpB;;OAEG;IACG,GAAG,CACP,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,yBAAyB,CAAC;CA+DtC"}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AccessibilityRunner - Runs accessibility tests using axe-core or IBM Equal Access (ACE)
|
|
3
|
+
* Replaces previous WAVE-based implementation with axe-core and accessibility-checker.
|
|
4
|
+
*/
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import { IMPACT_ORDER } from '../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Debug logger that writes to stderr to avoid interfering with MCP protocol
|
|
10
|
+
*/
|
|
11
|
+
function debugLog(...args) {
|
|
12
|
+
console.error(...args);
|
|
13
|
+
}
|
|
14
|
+
/** Default axe-core tags for WCAG 2.1 AA */
|
|
15
|
+
const DEFAULT_AXE_TAGS = [
|
|
16
|
+
'wcag2a',
|
|
17
|
+
'wcag2aa',
|
|
18
|
+
'wcag21a',
|
|
19
|
+
'wcag21aa',
|
|
20
|
+
'best-practice',
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Parse tagName, className, and id from HTML snippet or path.dom string.
|
|
24
|
+
* Used to populate domInfo so Element and Class selector columns are accurate.
|
|
25
|
+
*/
|
|
26
|
+
function parseDomFromSnippet(snippet, pathDom) {
|
|
27
|
+
let tagName = '';
|
|
28
|
+
let className = null;
|
|
29
|
+
let id = null;
|
|
30
|
+
if (snippet) {
|
|
31
|
+
const tagMatch = snippet.match(/<\s*(\w+)[\s>]/);
|
|
32
|
+
if (tagMatch)
|
|
33
|
+
tagName = tagMatch[1].toLowerCase();
|
|
34
|
+
const classMatch = snippet.match(/class\s*=\s*["']([^"']*)["']/);
|
|
35
|
+
if (classMatch)
|
|
36
|
+
className = classMatch[1].trim() || null;
|
|
37
|
+
const idMatch = snippet.match(/\bid\s*=\s*["']([^"']*)["']/);
|
|
38
|
+
if (idMatch)
|
|
39
|
+
id = idMatch[1].trim() || null;
|
|
40
|
+
}
|
|
41
|
+
if (!tagName && pathDom) {
|
|
42
|
+
const segments = pathDom.split(/[/.]/);
|
|
43
|
+
const last = segments[segments.length - 1];
|
|
44
|
+
if (last) {
|
|
45
|
+
const tagPart = last.replace(/\[\d+\]$/, '').trim();
|
|
46
|
+
if (tagPart)
|
|
47
|
+
tagName = tagPart.toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!tagName)
|
|
51
|
+
tagName = 'element';
|
|
52
|
+
return { tagName, className, id };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* AccessibilityRunner class - Handles accessibility test execution with axe-core or ACE
|
|
56
|
+
*/
|
|
57
|
+
export class AccessibilityRunner {
|
|
58
|
+
constructor() {
|
|
59
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
60
|
+
const currentDir = path.dirname(currentFile);
|
|
61
|
+
const serverDir = path.resolve(currentDir, '../../');
|
|
62
|
+
this.axePath = path.join(serverDir, 'node_modules', 'axe-core', 'axe.min.js');
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Navigate to URL and wait for page to be ready.
|
|
66
|
+
* @returns HTTP status code of the main document response (e.g. 200, 401), or undefined if unavailable.
|
|
67
|
+
*/
|
|
68
|
+
async navigateAndWait(page, url, waitStrategy = 'networkidle', timeout = 30000) {
|
|
69
|
+
debugLog(`Navigating to ${url}...`);
|
|
70
|
+
const startTime = Date.now();
|
|
71
|
+
const response = await page.goto(url, {
|
|
72
|
+
waitUntil: 'domcontentloaded',
|
|
73
|
+
timeout,
|
|
74
|
+
});
|
|
75
|
+
const status = response?.status();
|
|
76
|
+
if (status != null)
|
|
77
|
+
debugLog(`Page response status: ${status}`);
|
|
78
|
+
debugLog('Page navigation started');
|
|
79
|
+
const remainingTime = timeout - (Date.now() - startTime);
|
|
80
|
+
if (remainingTime > 0) {
|
|
81
|
+
try {
|
|
82
|
+
switch (waitStrategy) {
|
|
83
|
+
case 'networkidle':
|
|
84
|
+
await page.waitForLoadState('networkidle', {
|
|
85
|
+
timeout: Math.min(remainingTime, 6000),
|
|
86
|
+
});
|
|
87
|
+
debugLog('Page reached networkidle state');
|
|
88
|
+
break;
|
|
89
|
+
case 'load':
|
|
90
|
+
await page.waitForLoadState('load', {
|
|
91
|
+
timeout: Math.min(remainingTime, 6000),
|
|
92
|
+
});
|
|
93
|
+
debugLog('Page reached load state');
|
|
94
|
+
break;
|
|
95
|
+
case 'domcontentloaded':
|
|
96
|
+
debugLog('DOM content loaded');
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
const finalWaitTime = timeout - (Date.now() - startTime);
|
|
100
|
+
if (finalWaitTime > 1000) {
|
|
101
|
+
try {
|
|
102
|
+
await page.waitForFunction(() => (typeof document !== 'undefined' &&
|
|
103
|
+
document.readyState === 'complete' &&
|
|
104
|
+
document.body !== null), { timeout: Math.min(finalWaitTime, 2000) });
|
|
105
|
+
debugLog('DOM is ready');
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
debugLog('DOM readiness check timed out, proceeding anyway...');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
debugLog('Page still loading, but proceeding with analysis...');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
debugLog(`Page loading completed in ${Date.now() - startTime}ms - proceeding with accessibility analysis`);
|
|
117
|
+
return status;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Build axe run options (runOnly tags)
|
|
121
|
+
*/
|
|
122
|
+
buildAxeOptions(tags) {
|
|
123
|
+
const runOnly = tags && tags.length > 0 ? [...tags] : [...DEFAULT_AXE_TAGS];
|
|
124
|
+
return { runOnly };
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Run axe-core analysis in the browser and return raw axe result
|
|
128
|
+
*/
|
|
129
|
+
async runAxeAnalysis(page, tags) {
|
|
130
|
+
const axeOptions = this.buildAxeOptions(tags);
|
|
131
|
+
await page.addScriptTag({ path: this.axePath });
|
|
132
|
+
const rawResult = await page.evaluate((options) => {
|
|
133
|
+
return new Promise((resolve, reject) => {
|
|
134
|
+
if (typeof window.axe?.run !== 'function') {
|
|
135
|
+
reject(new Error('axe.run is not available'));
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
;
|
|
139
|
+
window
|
|
140
|
+
.axe.run(options)
|
|
141
|
+
.then(resolve)
|
|
142
|
+
.catch(reject);
|
|
143
|
+
});
|
|
144
|
+
}, axeOptions);
|
|
145
|
+
return rawResult;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Convert axe-core results to our AccessibilityResults format
|
|
149
|
+
*/
|
|
150
|
+
axeToAccessibilityResults(axeResult, url, testEnvironment) {
|
|
151
|
+
const violations = {};
|
|
152
|
+
const timestamp = new Date().toISOString();
|
|
153
|
+
axeResult.violations.forEach((v) => {
|
|
154
|
+
const categoryKey = v.id.toLowerCase().includes('color-contrast') ||
|
|
155
|
+
v.id.toLowerCase().includes('contrast')
|
|
156
|
+
? 'contrast'
|
|
157
|
+
: 'error';
|
|
158
|
+
if (!violations[categoryKey]) {
|
|
159
|
+
violations[categoryKey] = { count: 0, items: {} };
|
|
160
|
+
}
|
|
161
|
+
const xpaths = (v.nodes || []).map((n) => (n.target && n.target[0]) || '');
|
|
162
|
+
const domInfo = (v.nodes || []).map((n) => {
|
|
163
|
+
const selector = n.target && n.target[0];
|
|
164
|
+
const { tagName, className, id } = parseDomFromSnippet(n.html ?? null, selector);
|
|
165
|
+
return {
|
|
166
|
+
innerHTML: n.html ? n.html.substring(0, 200) : null,
|
|
167
|
+
selector,
|
|
168
|
+
tagName,
|
|
169
|
+
className,
|
|
170
|
+
id,
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
// Use axe-core native impact levels (critical, serious, moderate, minor)
|
|
174
|
+
const impact = v.impact?.toLowerCase() ?? 'moderate';
|
|
175
|
+
const ruleData = {
|
|
176
|
+
count: v.nodes?.length ?? 0,
|
|
177
|
+
xpaths,
|
|
178
|
+
description: v.description ?? v.help ?? v.id,
|
|
179
|
+
domInfo,
|
|
180
|
+
tags: v.tags ?? [],
|
|
181
|
+
impact,
|
|
182
|
+
};
|
|
183
|
+
violations[categoryKey].items[v.id] = ruleData;
|
|
184
|
+
violations[categoryKey].count += ruleData.count;
|
|
185
|
+
});
|
|
186
|
+
return {
|
|
187
|
+
url,
|
|
188
|
+
timestamp,
|
|
189
|
+
testEngine: { name: 'axe-core', version: '4.x' },
|
|
190
|
+
testRunner: { name: 'Standalone Accessibility Analyzer' },
|
|
191
|
+
testEnvironment,
|
|
192
|
+
violations,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Map axe-style WCAG tags to IBM Equal Access policy IDs.
|
|
197
|
+
* ACE is scoped at scan time via setConfig({ policies }) — not post-filtered.
|
|
198
|
+
* wcag22* → WCAG_2_2
|
|
199
|
+
* wcag21* → WCAG_2_1
|
|
200
|
+
* wcag2* → WCAG_2_0
|
|
201
|
+
* best-practice / (default) → IBM_Accessibility
|
|
202
|
+
*/
|
|
203
|
+
acePolicesFromTags(tags) {
|
|
204
|
+
if (!tags || tags.length === 0)
|
|
205
|
+
return ['IBM_Accessibility'];
|
|
206
|
+
if (tags.some((t) => t.startsWith('wcag22')))
|
|
207
|
+
return ['WCAG_2_2'];
|
|
208
|
+
if (tags.some((t) => t.startsWith('wcag21')))
|
|
209
|
+
return ['WCAG_2_1'];
|
|
210
|
+
if (tags.some((t) => t.startsWith('wcag2')))
|
|
211
|
+
return ['WCAG_2_0'];
|
|
212
|
+
return ['IBM_Accessibility'];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Run IBM Equal Access (accessibility-checker) analysis on HTML content.
|
|
216
|
+
* ACE never fetches URLs; the caller loads the page in Playwright and passes the final HTML
|
|
217
|
+
* (including everything changed by JavaScript). This avoids ACE's internal Puppeteer launch.
|
|
218
|
+
* WCAG level/policy is configured via setConfig before the scan — tags are engine settings.
|
|
219
|
+
*/
|
|
220
|
+
async runACEAnalysis(htmlContent, url, tags) {
|
|
221
|
+
const aChecker = await import('accessibility-checker');
|
|
222
|
+
const label = `audit-${Date.now()}`;
|
|
223
|
+
const policies = this.acePolicesFromTags(tags);
|
|
224
|
+
debugLog(`ACE policies: ${policies.join(', ')}`);
|
|
225
|
+
try {
|
|
226
|
+
await aChecker.setConfig({ policies, ruleArchive: 'latest' });
|
|
227
|
+
const result = await aChecker.getCompliance(htmlContent, label);
|
|
228
|
+
const report = result.report;
|
|
229
|
+
return this.aceToAccessibilityResults(report, url);
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
await aChecker.close?.();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Compare impact severity (higher = worse). Used to take the worst impact per rule.
|
|
237
|
+
* Uses IMPACT_ORDER for both axe and ACE native levels.
|
|
238
|
+
*/
|
|
239
|
+
impactRank(a) {
|
|
240
|
+
if (!a)
|
|
241
|
+
return 0;
|
|
242
|
+
return IMPACT_ORDER[a.toLowerCase()] ?? 2;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Convert ACE report to our AccessibilityResults format.
|
|
246
|
+
* Uses ACE native levels (violation, potentialviolation, recommendation, etc.).
|
|
247
|
+
*/
|
|
248
|
+
aceToAccessibilityResults(report, url) {
|
|
249
|
+
const violations = { error: { count: 0, items: {} } };
|
|
250
|
+
const timestamp = new Date().toISOString();
|
|
251
|
+
const violationItems = report.results.filter((r) => r.level === 'violation' ||
|
|
252
|
+
r.level === 'potentialviolation' ||
|
|
253
|
+
r.level === 'recommendation' ||
|
|
254
|
+
r.level === 'potentialrecommendation' ||
|
|
255
|
+
r.level === 'manual');
|
|
256
|
+
violationItems.forEach((item) => {
|
|
257
|
+
const ruleId = item.ruleId;
|
|
258
|
+
// Use ACE native level (violation, potentialviolation, recommendation, etc.)
|
|
259
|
+
const itemImpact = item.level.toLowerCase();
|
|
260
|
+
if (!violations.error.items[ruleId]) {
|
|
261
|
+
violations.error.items[ruleId] = {
|
|
262
|
+
count: 0,
|
|
263
|
+
xpaths: [],
|
|
264
|
+
description: item.message,
|
|
265
|
+
domInfo: [],
|
|
266
|
+
tags: [],
|
|
267
|
+
impact: itemImpact,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const rule = violations.error.items[ruleId];
|
|
271
|
+
rule.count += 1;
|
|
272
|
+
rule.xpaths.push(item.path.dom || '');
|
|
273
|
+
const { tagName, className, id } = parseDomFromSnippet(item.snippet ?? null, item.path.dom);
|
|
274
|
+
rule.domInfo.push({
|
|
275
|
+
innerHTML: item.snippet ? item.snippet.substring(0, 200) : null,
|
|
276
|
+
selector: item.path.dom,
|
|
277
|
+
tagName,
|
|
278
|
+
className,
|
|
279
|
+
id,
|
|
280
|
+
});
|
|
281
|
+
if (itemImpact && this.impactRank(itemImpact) > this.impactRank(rule.impact)) {
|
|
282
|
+
rule.impact = itemImpact;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
Object.values(violations.error.items).forEach((rule) => {
|
|
286
|
+
violations.error.count += rule.count;
|
|
287
|
+
});
|
|
288
|
+
return {
|
|
289
|
+
url,
|
|
290
|
+
timestamp,
|
|
291
|
+
testEngine: { name: 'IBM Equal Access', version: '4.x' },
|
|
292
|
+
testRunner: { name: 'accessibility-checker' },
|
|
293
|
+
testEnvironment: {
|
|
294
|
+
userAgent: 'accessibility-checker',
|
|
295
|
+
windowWidth: 1280,
|
|
296
|
+
windowHeight: 720,
|
|
297
|
+
},
|
|
298
|
+
violations,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Run accessibility analysis (axe in browser, or ACE via getCompliance)
|
|
303
|
+
*/
|
|
304
|
+
async runAccessibilityAnalysis(page, url, engine, tags) {
|
|
305
|
+
if (engine === 'ace') {
|
|
306
|
+
const html = await page.content();
|
|
307
|
+
return this.runACEAnalysis(html, url, tags);
|
|
308
|
+
}
|
|
309
|
+
const axeResult = await this.runAxeAnalysis(page, tags);
|
|
310
|
+
const viewport = page.viewportSize();
|
|
311
|
+
const testEnvironment = {
|
|
312
|
+
userAgent: await page.evaluate(() => navigator.userAgent),
|
|
313
|
+
windowWidth: viewport?.width ?? 1280,
|
|
314
|
+
windowHeight: viewport?.height ?? 720,
|
|
315
|
+
orientationType: await page
|
|
316
|
+
.evaluate(() => screen.orientation?.type)
|
|
317
|
+
.catch(() => undefined),
|
|
318
|
+
orientationAngle: await page
|
|
319
|
+
.evaluate(() => screen.orientation?.angle)
|
|
320
|
+
.catch(() => undefined),
|
|
321
|
+
};
|
|
322
|
+
return this.axeToAccessibilityResults(axeResult, url, testEnvironment);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Count total issues in violations
|
|
326
|
+
*/
|
|
327
|
+
countTotalIssues(violations) {
|
|
328
|
+
let total = 0;
|
|
329
|
+
Object.values(violations).forEach((category) => {
|
|
330
|
+
if (category && category.count) {
|
|
331
|
+
total += category.count;
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
return total;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Get a mapping of common accessibility rule IDs to their accessibility tags.
|
|
338
|
+
* Includes both axe-core and ACE-style rule IDs; WCAG 2.2 tags ensure strict
|
|
339
|
+
* tag filters (e.g. wcag22aa only) still include these rules.
|
|
340
|
+
*/
|
|
341
|
+
getRuleTagMapping() {
|
|
342
|
+
const wcagA = [
|
|
343
|
+
'wcag2a',
|
|
344
|
+
'wcag21a',
|
|
345
|
+
'wcag22a',
|
|
346
|
+
];
|
|
347
|
+
const wcagAA = [
|
|
348
|
+
'wcag2aa',
|
|
349
|
+
'wcag21aa',
|
|
350
|
+
'wcag22aa',
|
|
351
|
+
];
|
|
352
|
+
return {
|
|
353
|
+
'color-contrast': ['wcag21aa', 'wcag2aa', 'wcag22aa'],
|
|
354
|
+
'image-alt': wcagA,
|
|
355
|
+
label: wcagA,
|
|
356
|
+
'heading-order': wcagA,
|
|
357
|
+
'html-has-lang': wcagA,
|
|
358
|
+
'link-name': wcagA,
|
|
359
|
+
'aria-valid-attr-value': wcagA,
|
|
360
|
+
tabindex: wcagA,
|
|
361
|
+
'button-name': wcagA,
|
|
362
|
+
'document-title': wcagA,
|
|
363
|
+
'heading_empty': wcagA,
|
|
364
|
+
'button_empty': wcagA,
|
|
365
|
+
'aria_reference_broken': wcagA,
|
|
366
|
+
contrast: ['wcag21aa', 'wcag2aa', 'wcag22aa'],
|
|
367
|
+
// ACE-style rule IDs (common patterns)
|
|
368
|
+
'RPT_Header_HasContent': wcagA,
|
|
369
|
+
'RPT_Button_AccessibleName': wcagA,
|
|
370
|
+
'RPT_Label_FormControls': wcagA,
|
|
371
|
+
'RPT_Elem_UniqueId': wcagA,
|
|
372
|
+
'IBMA_Color_Contrast_WCAG2AA': wcagAA,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Check if a rule matches any of the specified tags.
|
|
377
|
+
* Only uses ruleData.tags when the array is non-empty; otherwise falls back to
|
|
378
|
+
* the static mapping and finally defaults to true (include the rule).
|
|
379
|
+
* This prevents rules with tags:[] from being silently dropped.
|
|
380
|
+
*/
|
|
381
|
+
ruleMatchesTags(ruleId, ruleData, tags) {
|
|
382
|
+
if (!tags || tags.length === 0)
|
|
383
|
+
return true;
|
|
384
|
+
if (ruleData.tags && Array.isArray(ruleData.tags) && ruleData.tags.length > 0) {
|
|
385
|
+
return ruleData.tags.some((tag) => tags.includes(tag));
|
|
386
|
+
}
|
|
387
|
+
const mapping = this.getRuleTagMapping();
|
|
388
|
+
const ruleTags = mapping[ruleId];
|
|
389
|
+
if (ruleTags?.length) {
|
|
390
|
+
return ruleTags.some((tag) => tags.includes(tag));
|
|
391
|
+
}
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Filter accessibility results by tags
|
|
396
|
+
*/
|
|
397
|
+
filterByTags(results, tags) {
|
|
398
|
+
if (!tags || tags.length === 0)
|
|
399
|
+
return results;
|
|
400
|
+
const filteredViolations = {};
|
|
401
|
+
Object.entries(results.violations).forEach(([categoryKey, category]) => {
|
|
402
|
+
if (!category?.items)
|
|
403
|
+
return;
|
|
404
|
+
const filteredItems = {};
|
|
405
|
+
Object.entries(category.items).forEach(([ruleId, ruleData]) => {
|
|
406
|
+
if (this.ruleMatchesTags(ruleId, ruleData, tags)) {
|
|
407
|
+
filteredItems[ruleId] = ruleData;
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
if (Object.keys(filteredItems).length > 0) {
|
|
411
|
+
const categoryCount = Object.values(filteredItems).reduce((total, item) => total + (item.count || 0), 0);
|
|
412
|
+
filteredViolations[categoryKey] = {
|
|
413
|
+
count: categoryCount,
|
|
414
|
+
items: filteredItems,
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
return { ...results, violations: filteredViolations };
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Run accessibility test on a URL
|
|
422
|
+
*/
|
|
423
|
+
async run(page, config) {
|
|
424
|
+
const { url, waitForLoad = 'networkidle', timeout = 30000, tags, engine = 'axe', applyTagFilter = false, } = config;
|
|
425
|
+
try {
|
|
426
|
+
if (engine === 'ace') {
|
|
427
|
+
// Always load the page in Playwright and pass the final HTML to ACE (no separate ACE browser).
|
|
428
|
+
// This gives us JS-rendered content and supports Basic Auth; ACE only analyzes the HTML string.
|
|
429
|
+
const responseStatus = await this.navigateAndWait(page, url, waitForLoad, timeout);
|
|
430
|
+
const html = await page.content();
|
|
431
|
+
debugLog(`Running IBM Equal Access (ACE) analysis on page content (${url})...`);
|
|
432
|
+
const accessibilityResults = await this.runACEAnalysis(html, url, tags);
|
|
433
|
+
return {
|
|
434
|
+
accessibilityResults,
|
|
435
|
+
filteredResults: undefined,
|
|
436
|
+
appliedFilters: tags && tags.length > 0 ? { tags } : undefined,
|
|
437
|
+
responseStatus,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
const responseStatus = await this.navigateAndWait(page, url, waitForLoad, timeout);
|
|
441
|
+
debugLog(`Running axe-core analysis on ${url}...`);
|
|
442
|
+
const accessibilityResults = await this.runAccessibilityAnalysis(page, url, 'axe', tags);
|
|
443
|
+
const originalIssueCount = this.countTotalIssues(accessibilityResults.violations);
|
|
444
|
+
let filteredResults;
|
|
445
|
+
let appliedFilters;
|
|
446
|
+
if (applyTagFilter && tags && tags.length > 0) {
|
|
447
|
+
filteredResults = this.filterByTags(accessibilityResults, tags);
|
|
448
|
+
appliedFilters = { tags, originalIssueCount };
|
|
449
|
+
debugLog(`Filtered results: ${originalIssueCount} -> ${this.countTotalIssues(filteredResults.violations)} issues (tags: ${tags.join(', ')})`);
|
|
450
|
+
}
|
|
451
|
+
return {
|
|
452
|
+
accessibilityResults,
|
|
453
|
+
filteredResults,
|
|
454
|
+
appliedFilters,
|
|
455
|
+
responseStatus,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
catch (error) {
|
|
459
|
+
console.error('Error running accessibility test:', error);
|
|
460
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
461
|
+
throw new Error(`Accessibility test failed for ${url}: ${errorMessage}`);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
//# sourceMappingURL=accessibility-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility-runner.js","sourceRoot":"","sources":["../../src/core/accessibility-runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAUnC,OAAO,EAAE,YAAY,EAAE,MAAM,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
5
|
+
export interface ParsedUrlCredentials {
|
|
6
|
+
urlWithoutAuth: string;
|
|
7
|
+
username?: string;
|
|
8
|
+
password?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BasicAuthParams {
|
|
11
|
+
basicAuthUsername?: string;
|
|
12
|
+
basicAuthPassword?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse Basic Auth credentials from URL if present (e.g. https://user:password@host/path).
|
|
16
|
+
* Returns URL with credentials stripped and optional username/password.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseUrlCredentials(url: string): ParsedUrlCredentials;
|
|
19
|
+
/**
|
|
20
|
+
* Build the Authorization header value for HTTP Basic Auth.
|
|
21
|
+
* Returns "Basic <base64(user:password)>" or null if either credential is missing.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getBasicAuthHeader(username: string | undefined, password: string | undefined): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve URL and Basic Auth from a URL (possibly with user:password@host) and optional
|
|
26
|
+
* explicit username/password. Explicit params override credentials embedded in the URL.
|
|
27
|
+
* Returns normalized URL without auth and credentials suitable for passing to auditUrl etc.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveBasicAuth(url: string, explicitUsername?: string, explicitPassword?: string): {
|
|
30
|
+
urlWithoutAuth: string;
|
|
31
|
+
basicAuthUsername: string | undefined;
|
|
32
|
+
basicAuthPassword: string | undefined;
|
|
33
|
+
basicAuthHeader: string | null;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=basic-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-auth.d.ts","sourceRoot":"","sources":["../../src/core/basic-auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAcrE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,IAAI,CAIf;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,gBAAgB,CAAC,EAAE,MAAM,EACzB,gBAAgB,CAAC,EAAE,MAAM,GACxB;IACD,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAWA"}
|