{"id":29138189,"url":"https://github.com/salute-developers/snapshots-kit-ios","last_synced_at":"2025-06-30T13:43:37.871Z","repository":{"id":300811068,"uuid":"953856429","full_name":"salute-developers/snapshots-kit-ios","owner":"salute-developers","description":"Swift XCTest library for iOS UI \"Snapshot Testing\" (screenshots comparison)","archived":false,"fork":false,"pushed_at":"2025-06-23T17:51:59.000Z","size":61,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-23T18:45:00.742Z","etag":null,"topics":["screenshot-testing","snapshot-testing","swift","swiftui","testing","xctest"],"latest_commit_sha":null,"homepage":"https://github.com/salute-developers/snapshots-kit-ios-sample","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salute-developers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-24T07:30:15.000Z","updated_at":"2025-03-27T16:19:05.000Z","dependencies_parsed_at":"2025-06-23T18:45:02.984Z","dependency_job_id":"ad0a9fbc-64d8-4940-a96d-e8896e25f024","html_url":"https://github.com/salute-developers/snapshots-kit-ios","commit_stats":null,"previous_names":["salute-developers/snapshots-kit-ios"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/salute-developers/snapshots-kit-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salute-developers%2Fsnapshots-kit-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salute-developers%2Fsnapshots-kit-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salute-developers%2Fsnapshots-kit-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salute-developers%2Fsnapshots-kit-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salute-developers","download_url":"https://codeload.github.com/salute-developers/snapshots-kit-ios/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salute-developers%2Fsnapshots-kit-ios/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262784570,"owners_count":23363738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["screenshot-testing","snapshot-testing","swift","swiftui","testing","xctest"],"created_at":"2025-06-30T13:43:35.058Z","updated_at":"2025-06-30T13:43:37.861Z","avatar_url":"https://github.com/salute-developers.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS products Snapshot Testing\n\n`SDSnapshots` library provides `XCTestCase` asserts for UI screenshots comparison with reference image (and reference recording).\n\n- [iOS products Snapshot Testing](#ios-products-snapshot-testing)\n  - [Stack](#stack)\n  - [Features](#features)\n  - [Limitations](#limitations)\n  - [Usage](#usage)\n  - [Alternatives](#alternatives)\n  - [License](#license)\n  - [Thanks](#thanks)\n\n## Stack\n\n- **Xcode** 16.1\n- **iOS Simulator Runtime** 18.1\n- **Swift** 6.0\n\n## Features\n\n- Works both with `UIKit` and `SwiftUI`\n- Allows to test multiple devices layout at ones, using the single simulator device launch (cover iPhones, iPads, Split Views in a single test case)\n- Respects device orientation and safe area. Applies it from test run `SnapshotDevice` specification (not simulator's one). May render it as a visible border\n- Async API with concurrent implementation for faster test execution\n- Produced `new.png`, `diff.png`, `merge.png` on test failure help to visually spot difference between expectation and actual render\n- Accessibility snapshots to capture accessibility labels. May be handy during UIKit -\u003e SwiftUI refactor, tests automatically ensures that UI hints still present\n\n## Limitations\n\n- `Xcode` version change may break some tests. Either color components may vary (without visible difference) or layer/text border may shift due to antialiasing algo changes. `iOS SDK` (bundled with `Xcode.app`) and `iOS Simulator Runtime` versions have impact on `UIKit` behavior\n- `Xcode` version, `Simulator` device model and version should be fixed and frozen for your test scheme. `Xcode.app` update will usually  require you to commit breaking changes\n- `Git LFS` is strongly advised as tool for .png references storage. Images are significantly larger than text files, storing them directly in commit history will explode repository size\n- Animations have to be turned off to stabilize image capture result (use View model toggle). Otherwise test case will be unstable, captured animation frame may shift between test launches\n- `Snapshot Testing` target should have iOS app specified as the `TEST_HOST`, otherwise `UIKit` render pipe won't work\n- Therefore you need to pack test target code in `.xcodeproj`. Swift Packages currently do not allow us to declare iOS app targets\n- `View` instance have to be uniq per each `prepareSut()` invocation inside assert method. Sequential View re-appearance may affect layout\n- `SnapshotFiles` fails to locate files if project directory path contains spaces\n\n## Usage\n\nSee [example repository](https://github.com/salute-developers/snapshots-kit-ios-sample) for sample project and test code.\n\n## Alternatives\n\n- [swift-snapshot-testing by PointFree](https://github.com/pointfreeco/swift-snapshot-testing)\n  - ✅ Do not require Simulator Device launch and `TEST_HOST` app\n  - ✅ Wider capabilities (may assert any objects equality)\n  - ❌ Uses `CoreGraphics` rendering, `UIKit` views display is inaccurate (layer effects, borders, shadows, opacity may have visual artifacts)\n\n## License\n\nPackage is under [MIT License](LICENSE).\n\n## Thanks\n\n- [Максим Кузнецов](https://github.com/maxibello) – initial library design\n- [Бодров Александр](https://github.com/amidaleet) – `SwiftUI` support, respect of safe area, async API, concurrent Matcher, Matcher sensitivity calibration\n- [Сергей Уразов](https://github.com/urazov-s) – accessibility testing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalute-developers%2Fsnapshots-kit-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalute-developers%2Fsnapshots-kit-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalute-developers%2Fsnapshots-kit-ios/lists"}