Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/playbook-ui/accessibility-snapshot-ios
A library for generating snapshot images of components managed by Playbook with accessibility labels.
https://github.com/playbook-ui/accessibility-snapshot-ios
a11y a11y-testing accessibility ios playbook snapshot-testing swift swiftui visual-regression-testing
Last synced: 4 days ago
JSON representation
A library for generating snapshot images of components managed by Playbook with accessibility labels.
- Host: GitHub
- URL: https://github.com/playbook-ui/accessibility-snapshot-ios
- Owner: playbook-ui
- License: apache-2.0
- Created: 2020-10-27T07:55:01.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T07:11:28.000Z (4 months ago)
- Last Synced: 2024-11-05T19:17:56.476Z (7 days ago)
- Topics: a11y, a11y-testing, accessibility, ios, playbook, snapshot-testing, swift, swiftui, visual-regression-testing
- Language: Swift
- Homepage: https://playbook-ui.github.io/accessibility-snapshot-ios/documentation/playbookaccessibilitysnapshot
- Size: 3.69 MB
- Stars: 42
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PlaybookAccessibilitySnapshot
`PlaybookAccessibilitySnapshot` is an extension to [Playbook](https://github.com/playbook-ui/playbook-ios) that uses [AccessibilitySnapshot](https://github.com/cashapp/AccessibilitySnapshot) to produce snapshots with accessibility information such as activation points and labels.
---
## Usage
- [API Document](https://playbook-ui.github.io/accessibility-snapshot-ios/documentation/playbookaccessibilitysnapshot)
- [Example App](https://github.com/playbook-ui/accessibility-snapshot-ios/tree/main/Example)---
### AccessibilitySnapshot
```swift
final class AccessibilitySnapshotTests: XCTestCase {
func testTakeAccessibilitySnapshot() throws {
let directory = ProcessInfo.processInfo.environment["SNAPSHOT_DIR"]!try Playbook.default.run(
AccessibilitySnapshot(
directory: URL(fileURLWithPath: directory),
clean: true,
format: .png,
keyWindow: UIApplication.shared.windows.first { $0.isKeyWindow },
devices: [.iPhone11Pro(.portrait)]
)
)
}
}
```|Sample|Before|After|
|:-----|:-----|:----|
||||---
### Integration with Third-party Tools
The generated snapshot images with accessibility information can be used for more advanced visual regression testing by using a variety of third party tools.
#### [percy](https://percy.io)
---
## Requirements
- Swift 5.9+
- Xcode 15.0+
- iOS 13.0+---
## Installation
### [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app)
Select Xcode menu `File > Swift Packages > Add Package Dependency...` and enter repository URL with GUI.
```
Repository: https://github.com/playbook-ui/accessibility-snapshot-ios.git
```---
## Development
1. Run `make proj` at the root of this repository.
1. Open `Example/Example.xcworkspace` via Xcode.---
## License
Playbook is released under the [Apache 2.0 License](https://github.com/playbook-ui/accessibility-snapshot-ios/tree/main/LICENSE).