summaryrefslogtreecommitdiff
path: root/DomainDigUITests
diff options
context:
space:
mode:
Diffstat (limited to 'DomainDigUITests')
-rw-r--r--DomainDigUITests/AccessibilityAuditHarness.swift12
-rw-r--r--DomainDigUITests/AccessibilityAuditTests.swift15
2 files changed, 13 insertions, 14 deletions
diff --git a/DomainDigUITests/AccessibilityAuditHarness.swift b/DomainDigUITests/AccessibilityAuditHarness.swift
index ca4d12b..08ddedd 100644
--- a/DomainDigUITests/AccessibilityAuditHarness.swift
+++ b/DomainDigUITests/AccessibilityAuditHarness.swift
@@ -85,6 +85,18 @@ enum AccessibilityAuditHarness {
timeout = nil
do {
try app.performAccessibilityAudit { issue in
+ // WCAG 1.4.3 exempts inactive components from contrast
+ // requirements, but the audit flags them anyway. Inspect's
+ // Run button is disabled until a domain is typed, so the
+ // empty state reported a contrast failure that was never a
+ // real defect. Suppressing on the rule beats driving the UI
+ // to enable the control: typing raises the keyboard, which
+ // then follows the audit onto later screens and flags the
+ // system emoji picker's category buttons.
+ if issue.auditType.contains(.contrast), issue.element?.isEnabled == false {
+ return true
+ }
+
let isEnforced = !enforcedAuditTypes.intersection(issue.auditType).isEmpty
let marker = isEnforced ? "FAIL" : "report"
// Include the element so the burndown says *what* to fix, not
diff --git a/DomainDigUITests/AccessibilityAuditTests.swift b/DomainDigUITests/AccessibilityAuditTests.swift
index 63ae584..6a90bac 100644
--- a/DomainDigUITests/AccessibilityAuditTests.swift
+++ b/DomainDigUITests/AccessibilityAuditTests.swift
@@ -17,20 +17,7 @@ final class AccessibilityAuditTests: XCTestCase {
// MARK: Per-screen audits
func testInspectScreen() throws {
- let app = AccessibilityAuditHarness.launch()
- app.selectRootTab("Inspect")
-
- // Type a domain so the Run button is enabled. A disabled control has no
- // contrast requirement under WCAG 1.4.3, but the audit still flags it,
- // so auditing the empty state would report a false positive forever.
- let field = app.textFields.firstMatch
- if field.waitForExistence(timeout: 5) {
- field.tap()
- field.typeText("example.com")
- }
-
- let audited = try AccessibilityAuditHarness.audit(app, screen: "inspect", test: self)
- try XCTSkipUnless(audited, "Audit did not complete in time for Inspect")
+ try auditRootTab("Inspect")
}
func testDashboardScreen() throws {