Update accessbility tests to fix false positives

This commit is contained in:
Josh at WLTechBlog
2025-12-08 13:03:17 -07:00
parent ac71ce8797
commit ae0a3a789e
2 changed files with 184 additions and 24 deletions

View File

@@ -94,6 +94,9 @@ func handleOptionalNavigation(cremoteServer *CremoteServer, params map[string]an
if err != nil {
return "", fmt.Errorf("failed to load URL: %w", err)
}
// Wait 3 seconds after page load to ensure JavaScript has executed
time.Sleep(3 * time.Second)
} else if clearCache && tab != "" {
// Clear cache even if not navigating
err := cremoteServer.client.ClearCache(tab, timeout)
@@ -242,6 +245,9 @@ func main() {
return nil, fmt.Errorf("failed to load URL: %w", err)
}
// Wait 3 seconds after page load to ensure JavaScript has executed
time.Sleep(3 * time.Second)
message := fmt.Sprintf("Successfully navigated to %s in tab %s", url, tab)
var extractedData string
@@ -4877,7 +4883,7 @@ func main() {
// Register web_keyboard_test tool
mcpServer.AddTool(mcp.Tool{
Name: "web_keyboard_test_cremotemcp",
Description: "Test keyboard navigation and accessibility including tab order, focus indicators, and keyboard traps. Uses real Tab key simulation by default for accurate :focus-within testing.",
Description: "Test keyboard navigation and accessibility including tab order, focus indicators, and keyboard traps. Uses real Tab key simulation by default for accurate :focus-within and :focus-visible testing. Automatically detects accessibility plugins (Accessifix, UserWay, AccessiBe, AudioEye, EqualWeb) and provides confidence scoring for focus indicator findings.",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]any{
@@ -5231,7 +5237,7 @@ func main() {
// Register web_page_accessibility_report tool
mcpServer.AddTool(mcp.Tool{
Name: "web_page_accessibility_report_cremotemcp",
Description: "Perform comprehensive accessibility assessment of a page and return a summarized report with actionable findings. This tool combines multiple accessibility tests (axe-core, contrast, keyboard, forms) and returns only the critical findings in a token-efficient format. Automatically injects axe-core if not already loaded.",
Description: "Perform comprehensive accessibility assessment of a page and return a summarized report with actionable findings. This tool combines multiple accessibility tests (axe-core, contrast, keyboard, forms) and returns only the critical findings in a token-efficient format. Keyboard testing uses real Tab key simulation for accurate :focus-visible detection and includes accessibility plugin detection with confidence scoring. Automatically injects axe-core if not already loaded.",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]any{
@@ -5500,7 +5506,7 @@ func main() {
// Register web_keyboard_audit tool
mcpServer.AddTool(mcp.Tool{
Name: "web_keyboard_audit_cremotemcp",
Description: "Perform keyboard navigation assessment with actionable results. Uses real Tab key simulation by default for accurate :focus-within testing. Returns summary of issues rather than full element lists, reducing token usage by ~80%.",
Description: "Perform keyboard navigation assessment with actionable results. Uses real Tab key simulation by default for accurate :focus-within and :focus-visible testing. Automatically detects accessibility plugins (Accessifix, UserWay, AccessiBe, AudioEye, EqualWeb) and provides confidence scoring for focus indicator findings. Returns summary of issues rather than full element lists, reducing token usage by ~80%.",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]any{