项目作者: playbook-ui

项目描述 :
A library for generating snapshot images of components managed by Playbook with accessibility labels.
高级语言: Swift
项目地址: git://github.com/playbook-ui/accessibility-snapshot-ios.git
创建时间: 2020-10-27T07:55:01Z
项目社区:https://github.com/playbook-ui/accessibility-snapshot-ios

开源协议:Apache License 2.0

下载



Playbook

PlaybookAccessibilitySnapshot

Swift5
CI Status
Lincense


Release
Swift Package Manager

PlaybookAccessibilitySnapshot is an extension to Playbook that uses AccessibilitySnapshot to produce snapshots with accessibility information such as activation points and labels.


Usage


AccessibilitySnapshot

  1. final class AccessibilitySnapshotTests: XCTestCase {
  2. func testTakeAccessibilitySnapshot() throws {
  3. let directory = ProcessInfo.processInfo.environment["SNAPSHOT_DIR"]!
  4. try Playbook.default.run(
  5. AccessibilitySnapshot(
  6. directory: URL(fileURLWithPath: directory),
  7. clean: true,
  8. format: .png,
  9. keyWindow: UIApplication.shared.windows.first { $0.isKeyWindow },
  10. devices: [.iPhone11Pro(.portrait)]
  11. )
  12. )
  13. }
  14. }

snapshot

Sample Before After
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

percy


Requirements

  • Swift 5.9+
  • Xcode 15.0+
  • iOS 13.0+

Installation

Swift Package Manager

Select Xcode menu File > Swift Packages > Add Package Dependency... and enter repository URL with GUI.

  1. Repository: https://github.com/playbook-ui/accessibility-snapshot-ios.git

Development

  1. Run make proj at the root of this repository.
  2. Open Example/Example.xcworkspace via Xcode.

License

Playbook is released under the Apache 2.0 License.



Playbook