Swiftpack.co -  playbook-ui/accessibility-snapshot-ios as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
playbook-ui/accessibility-snapshot-ios
A library for generating snapshot images of components managed by Playbook with accessibility labels.
.package(url: "https://github.com/playbook-ui/accessibility-snapshot-ios.git", from: "0.2.1")

Playbook

PlaybookAccessibilitySnapshot

Swift5 CI Status Lincense
Release CocoaPods

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


Usage


AccessibilitySnapshot

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)]
            )
        )
    }
}
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.3+
  • Xcode 12.2+
  • iOS 12.0+

Installation

CocoaPods

Add the following to your Podfile:

target 'YourPlaybook' do
  pod 'Playbook'

  target 'YourPlaybookTests' do
    inherit! :search_paths

    pod 'PlaybookAccessibilitySnapshot'
  end
end

Swift Package Manager

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.
  2. Open Example/Example.xcworkspace via Xcode.
  3. Develop a PlaybookAccessibilitySnapshot installed as a development pods.

License

Playbook is released under the Apache 2.0 License.


Playbook

GitHub

link
Stars: 31
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Beta version: 0.2.1
3 weeks ago
  • Add support for Swift Package Manager #17

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics