Audit your checks
audit: a11y in a check’s file does the same for that check.
Report warnings, or fail on new findings
--a11y also audits the screens read while a model drives the steps or a recorded path replays, and reports what it finds as warnings:
a11y: warn or a11y: strict in its file. --a11y applies to every check, and a check that says strict stays strict. --audit a11y and audit: a11y mean --a11y=strict. mobster test pr doesn’t take --a11y: put a11y: in the checks it runs.
These reads ask WebDriverAgent for visibility and traits too, so they take longer than the usual screen reads. The audit covers the XML Mobster reads, including screens in passing that it saves no frame for, not every frame the app draws. A finding from a read with no saved frame has no frame link.
What the audit finds
text-clipped reads frames, not pixels. Text that truncates inside a frame of the right size isn’t found, so a clean run doesn’t prove that Dynamic Type works.
The tree audit doesn’t check color contrast. The tree has no colors, and a screenshot’s pixels under translucent bars, images and gradients give no foreground and background you can trust. Apple’s audit on a real iPhone checks contrast.
Start from a baseline
Each finding has alevel in results.json:
warn: reported, and the check passes. This is the level of--a11y.fail: with--a11y=strict, the check fails withreason.classfinding.known: the finding is in the project’s baseline. It is listed and never fails.
.mobster/a11y-baseline.json. From then on, mobster test --a11y=strict in CI fails only on a finding that isn’t in it:
--update-a11y-baseline drops its entry.
--update-a11y-baseline replaces the file only when every check it asked for ended on a finished attempt that audited at least one screen with complete coverage. A retried check counts by its last attempt, and a strict finding still writes the file. A stopped check, an incomplete scan, --repeat or a baseline that changed during the run leaves the file as it was, and the run says why. A baseline file that isn’t valid stops a run, and a complete refresh replaces it.
A refresh saves no new recorded path and stages no healed one. An unchanged approved replay, or a fresh run of the steps, supplies the screens. If a replay needs a heal, review it or record the path in a separate run, then refresh again. After you change the baseline, review any pending heal, because its proof no longer matches.
Know when the audit is incomplete
Each run’sresult.json reports screenCoverage: complete, and a11yScreens, the unique screens it audited. Coverage is incomplete when a screen read fails, falls back to pixels, is still in flight when the verdict starts, or passes the cap of 60 unique screens. Then a clean last screen can’t certify a strict audit or a throughout assertion: the check needs review, unless an assertion or a strict finding already failed it. Warning audits stay advisory.
Assertions read labels, identifiers, values and placeholders whole, up to 4,000 characters each. A longer one is refused as evidence, because Mobster never decides from a shortened prefix. A screen’s XML is read up to 8 million characters. A missing read between steps makes coverage incomplete, and a missing last read makes the check couldnt_run.
Run Apple’s audit on a real iPhone
audit: ax-device in a check runs Apple’s own accessibility audit on the iPhone, for what the tree can’t show: color contrast, hit regions, missing element descriptions, clipped text and Dynamic Type. It calls no model and sends nothing off your Mac. Set MOBSTER_EXPERIMENTAL_AUDIT=1 to use it.
It runs on a real iPhone only, in the phone’s axAuditDaemon service, which a simulator doesn’t have. On a simulator, the check adds one review finding that says so, and audit: a11y covers the screen.
Install the audit tool yourself: pipx install pymobiledevice3. pymobiledevice3 (GPL-3.0-or-later) is a separate program. Mobster runs pymobiledevice3 developer accessibility run-audit over the tunnel macOS keeps to a phone paired for development, reads the JSON it prints, and never imports or bundles it. Without it, the check adds one device-audit-no-tool review finding that says how to install it, and audits nothing.
The phone must run iOS 17 or later, be paired with this Mac for development, be unlocked, be in Developer Mode and have the developer disk image mounted. Mobster never pairs a phone for this. A phone that misses one gives one device-audit-unavailable review finding, which names the reason, such as pymobiledevice3 exited 1. Findings carry level: review, so a run with any ends needs_review. Each screen is audited once, up to 30 screens a run, with 45 seconds per command.
Each finding has an id (device-contrast, device-hit-region, device-description, device-element-detection, device-text-clipped, device-dynamic-text), a guideline, the rect in points and the frame.
Read the findings
results.json: each device result’sfindingslistsid,audit,guideline,level,key,message, theelement(role,label,identifier,rectin points) and theframewhen one was saved.- Each run’s
result.json:screenCoverage, as above. - The HTML report: a tag in the header counts new findings, warnings and baseline entries, and each check’s page lists its findings, with a frame when one was saved.
junit.xml: one extra<testcase>per finding in the device’s<testsuite>, named<check>: <rule>, <element>. Afailfinding has a<failure type="accessibility">. Awarnfinding passes and carriesWarning: …in<system-out>. Aknownfinding gets no case.- The terminal: one
Accessibility:line after the counts.
--device.