cashapp / AccessibilitySnapshot
Easy regression testing for iOS accessibility
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing cashapp/AccessibilitySnapshot in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewAccessibilitySnapshot AccessibilitySnapshot makes it simple to add regression tests for accessibility in iOS apps. The framework builds on the idea of snapshot testing to provide snapshots of the accessibility hierarchy. Getting Started By default, AccessibilitySnapshot uses SnapshotTesting to record snapshots and perform comparisons. The framework also includes support for using iOSSnapshotTestCase as the snapshotting engine instead. Before setting up accessibility snapshot tests, make sure your project is set up for standard snapshot testing. Accessibility snapshot tests require that the test target has a host application. See the Extensions section below for a list of other available snapshotting options. Swift Package Manager Install with Swift Package Manager by adding the following to your : Next, add AccessibilitySnapshot as a dependency to your test target: To use only the core accessibility parser, add a dependency on the Core library alone: To use iOSSnapshotTestCase to perform image comparisons, add a dependency on for Swift testing or for Objective-C. Usage AccessibilitySnapshot builds on top of existing snapshot frameworks to add support for snapshotting your app's accessibility. By default it uses the SnapshotTesting framework for snapshotting, but can be switched over to iOSSnapshotTestCase as well. Getting Started with SnapshotTesting AccessibilitySnapshot provides an snapshotting strategy that can be used with SnapshotTesting's snapshot assertions. Snapshots can also be customized in a few ways, for example controlling when to include indicators for the accessibility activation point of each element. By default, these indicators are shown when the activation point is different than the default activation point for that view. You can override this behavior for each snapshot: Getting Started with iOSSnapshotTestCase To run a snapshot test, simply call the method: Since AccessibilitySnapshot is built on top of iOSSnapshotTestCase, it uses the same mechanism to record snapshots (setting the property) and supports many of the same features like device agnostic file names and specifying identifiers for each snapshot: Snapshots can also optionally include indicators for the accessibility activation point of each element. By default, these indicators are shown when the activation point is different than the default activation point for that view. You can override this behavior for each snapshot: You can also run accessibility snapshot tests from Objective-C: Requirements • Xcode 13.2.1 or later • iOS 13.0 or later Contributing We love our contributors! Please read our contributing guidelines prior to submitting a pull request. Extensions Have you written your own extension? Add it here and submit a pull request! • PlaybookAccessibilitySnapshot brings accessibility snapshot testing support to Playbook. License