{"id":13995675,"url":"https://github.com/intere/UITestKit","last_synced_at":"2025-07-22T22:31:54.152Z","repository":{"id":56925046,"uuid":"109619843","full_name":"intere/UITestKit","owner":"intere","description":"Programmatic UI Tests (not using the Apple UI Test Framework).  XCTest-based tests.","archived":false,"fork":false,"pushed_at":"2022-05-31T13:58:42.000Z","size":1218,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-11-26T12:42:21.016Z","etag":null,"topics":["automated-testing","cocoapods","ios","swift","testing","ui-testing"],"latest_commit_sha":null,"homepage":null,"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/intere.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-11-05T21:55:27.000Z","updated_at":"2023-10-15T10:22:41.000Z","dependencies_parsed_at":"2022-08-20T22:50:22.917Z","dependency_job_id":null,"html_url":"https://github.com/intere/UITestKit","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intere%2FUITestKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intere%2FUITestKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intere%2FUITestKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intere%2FUITestKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intere","download_url":"https://codeload.github.com/intere/UITestKit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227190282,"owners_count":17745238,"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":["automated-testing","cocoapods","ios","swift","testing","ui-testing"],"created_at":"2024-08-09T14:03:32.560Z","updated_at":"2024-11-29T18:30:49.261Z","avatar_url":"https://github.com/intere.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"\n\u003cimg src=\"https://github.com/intere/UITestKit/blob/master/Example/UITestKit/Media.xcassets/AppLogo.imageset/AppLogo.png?raw=true\" width=\"150\"\u003e\n\n# UITestKit\n\n### An iOS Library for UI Testing\n\n## Features\n- UI Testing from a vanilla `XCTest` target\n    - Enable / Disable UI Animations\n    - Take screenshots on test assertion failures\n    - `waitForCondition` function to free up the UI thread and wait for your block condition to become true (or timeout and move on)\n    - `pauseForUIDebug()` function to allow you to pause a (configurable) amount of time between steps in your tests\n        - function becomes a no-op when `shouldPauseUI` is false (the default)\n    - variables to get you the top view controller\n- Example App to demonstrate capabilities\n\n[![Build Status](https://travis-ci.org/intere/UITestKit.svg?branch=develop)](https://travis-ci.org/intere/UITestKit)\n[![Documentation](https://intere.github.io/UITestKit/badge.svg)](https://intere.github.io/UITestKit/index.html)\n[![Platform](https://img.shields.io/badge/Platforms-iOS-lightgray.svg?style=flat)](http://cocoadocs.org/docsets/UITestKit)\n[![CocoaPods](https://img.shields.io/cocoapods/v/UITestKit.svg)](https://cocoapods.org/pods/UITestKit)  \n [![CocoaPods](https://img.shields.io/cocoapods/dt/UITestKit.svg)](https://cocoapods.org/pods/UITestKit) [![CocoaPods](https://img.shields.io/cocoapods/dm/UITestKit.svg)](https://cocoapods.org/pods/UITestKit)\n\n## Why not use XCUITests?\n- UITestKit lets you interact with the application code directly from test code\n    - Easier mocking of model objects\n    - Easier invocation of ViewControllers\n    - Lower level access to your application\n- UITestKit provides convenience variables for taking screenshots from failures\n- UITestKit can be far less rigid than XCUITests\n\n## Example\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n![Example Tests](https://user-images.githubusercontent.com/2284832/50541549-86a3e080-0b65-11e9-95d2-176b9ce3164b.gif)\n\n## Requirements\n- iOS 9.0 or higher\n\n## Installation\n\nUITestKit is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'UITestKit'\n```\n\n### Code Examples\n\n```swift\n/// Pre-test initialization\noverride func setUp() {\n    super.setUp()\n    // Don't show view transitions - this will help prevent timing related failures\n    disableAnimations()\n    // pause when pauseForUIDebug() is called\n    shouldPauseUI = true\n    // how long to pause for when pauseForUIDebug() is called\n    pauseTimer = 0.3\n\n    // Now do other setup tasks\n}\n```\n\n```swift\n/// Tests logging in to the application\nfunc testLoginSuccess() {\n\n    // Verify that we're at the Main VC or fail and take a screenshot\n    XCTAssertTrue(waitForCondition({ self.mainVC != nil }, timeout: 3), topVCScreenshot)\n    pauseForUIDebug()\n    mainVC?.loadEmailLoginScreen()\n\n    // Verify that we're at the Sign in VC or fail and take a screenshot\n    XCTAssertTrue(waitForCondition({ self.signInVC != nil}, timeout: 1), topVCScreenshot)\n    pauseForUIDebug()\n\n    // Simulate typing email\n    if let emailText = signInVC?.emailText {\n        emailText.text = \"user@domain.com\"\n        pauseForUIDebug()\n    }\n\n    // simulate typing password\n    if let passwordText = signInVC?.passwordText {\n        passwordText.text = \"UserPassword\"\n        pauseForUIDebug()\n    }\n\n    // log in\n    signInVC?.login()\n\n    // Verify that we've signed in successfully and are at the Welcome VC or fail and take a screenshot\n    XCTAssertTrue(waitForCondition({ self.welcomeVC != nil}, timeout: 5), topVCScreenshot)\n}\n```\n\n### Best Practices\n- It is recommended to create a `BaseUITest` class that specializes `UITestKitBase` and provides convenience variables for your application's view controllers:\n\n```swift\n/// Gets you the `SquareTabVC` if it's the topVC\nvar squareTabVC: SquareTabVC? {\n    return topVC as? SquareTabVC\n}\n\n/// Gets the `ShapesTableViewController`\nvar shapeTableVC: ShapesTableViewController? {\n    return topVC as? ShapesTableViewController\n}\n```\n\n- It is recommend that you use the screenshot capability when checking for specific UI's to be visible or in a specific UI state:\n\n```swift\nXCTAssertTrue(waitForCondition({ self.shapeTableVC != nil }, timeout: 1), topVCScreenshot)\n```\n\n`topVCScreenshot` will produce failures like this:\n\n![Sample Test Failure with Screenshot](https://user-images.githubusercontent.com/2284832/50541750-3a5a9f80-0b69-11e9-9a49-1b14615e0d33.png)\n\n`The Screenshot that is produced will look something like the following:`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/2284832/50541754-4f373300-0b69-11e9-9db8-f5f9e7a4b779.png\" width=\"300\"\u003e\n\n\n## Author\n\n[Eric Internicola](https://github.com/intere) | [Eric's Github Site](https://intere.github.io/)\n\n## License\n\nUITestKit is available under the MIT license. See the [LICENSE file](https://raw.githubusercontent.com/intere/UITestKit/master/LICENSE) for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintere%2FUITestKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintere%2FUITestKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintere%2FUITestKit/lists"}