{"id":2130,"url":"https://github.com/tooploox/SnappyTestCase","last_synced_at":"2025-08-02T23:32:04.024Z","repository":{"id":62455740,"uuid":"92176768","full_name":"tooploox/SnappyTestCase","owner":"tooploox","description":"iOS Simulator type agnostic snapshot testing, built on top of the FBSnapshotTestCase.","archived":false,"fork":false,"pushed_at":"2018-03-16T14:16:18.000Z","size":18381,"stargazers_count":15,"open_issues_count":4,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-08T16:47:43.522Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tooploox.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}},"created_at":"2017-05-23T13:34:07.000Z","updated_at":"2019-10-11T17:15:54.000Z","dependencies_parsed_at":"2022-11-02T00:01:25.812Z","dependency_job_id":null,"html_url":"https://github.com/tooploox/SnappyTestCase","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooploox%2FSnappyTestCase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooploox%2FSnappyTestCase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooploox%2FSnappyTestCase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooploox%2FSnappyTestCase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tooploox","download_url":"https://codeload.github.com/tooploox/SnappyTestCase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503133,"owners_count":17930517,"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":[],"created_at":"2024-01-05T20:16:05.433Z","updated_at":"2024-12-06T17:30:47.219Z","avatar_url":"https://github.com/tooploox.png","language":"Swift","funding_links":[],"categories":["Testing"],"sub_categories":["Other Testing","Other free courses"],"readme":"![Tooploox](https://github.com/tooploox/SnappyTestCase/raw/master/tooploox-logo.png)\n\nSnappyTestCase\n======\n\niOS Simulator type agnostic snapshot testing, built on top of the [FBSnapshotTestCase](https://github.com/facebook/ios-snapshot-test-case).\n\nWhy?\n----\n\nSnapshot testing helps to deliver views that scale correctly with a wide range of screen sizes. When it comes to view controllers, we usually want to ensure they keep visual quality on a various set of existing devices, in each supported orientation. Test suite could be run on numerous variants of iOS Simulators. However, this could be a really time-consuming task, for sure not acceptable during a development process. SnappyTestCase tackles this issue by combining test with a set of device definitions (each one including screen size, scale, and orientation) to validate with, ignoring real device simulator context information.\n\n## Features\n\n- Simulator type insensitive snapshot testing =\u003e restart free, quick various device testing\n- Handy definitions of iOS devices to test with - both iPhone and iPad, with chainable filtering API\n- Forcing simulator to adopt `scale` and `orientation` according to test device definition\n- Adding device type and orientation to reference file names\n- You can resize one and validate snapshot of another view (for example, you can resize whole window with `UITabBarController` and validate snapshot of its tab bar only)\n- Optional closure executed just before verifying view\n\nGetting Started\n-----------\n\nValidating view controller on all existing iPhones, with portrait orientation (default):\n\n```swift\nfunc testAllDevices() {\n    let window = UIWindow()\n    window.makeKeyAndVisible()\n    window.rootViewController = ExampleViewController(nibName: nil, bundle: nil)\n    \n    verifyViewSnaps(DeviceRack.iPhone.all, view: window)\n}\n```\n\nFor more examples of usage check out `SnappyDemo` project.\n\nDefining device set cheat sheet\n-------------------------------\n\n| Expression                               | Device set description                   | Snapshot count |\n| ---------------------------------------- | ---------------------------------------- | :------------: |\n| `DeviceRack.iPhone.all.landscape`        | All iPhones, in landscape orientation    |       4        |\n| `DeviceRack.iPhone.all.portrait.uniqueWidths` | Set of iPhones covering all possible screen widths in portrait orientation |       3        |\n| ` DeviceRack.iPad.retina.landscape`      | Retina 9.7\" / 7.9\" iPad, landscape       |       1        |\n\nInstallation using CocoaPods\n----------------------------\n\nAdd following line to your test target pods list in `Podfile`:\n\n`pod 'SnappyTestCase'`\n\nLicense\n-------\n\n`SnappyTestCase` is distributed under the Apache 2.0 license.\n\n## Feedback\n\nWe love receiving feedback and we encourage you to contact us and share your thoughts either via e-mail [hello@tooploox.com](mailto:hello@tooploox.com) or Twitter by mentioning [@tooploox](https://twitter.com/tooploox).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftooploox%2FSnappyTestCase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftooploox%2FSnappyTestCase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftooploox%2FSnappyTestCase/lists"}