{"id":28438483,"url":"https://github.com/hhru/rafinad","last_synced_at":"2025-07-29T14:10:25.811Z","repository":{"id":293844913,"uuid":"982719347","full_name":"hhru/Rafinad","owner":"hhru","description":"A DSL for UI testing of iOS and tvOS apps, featuring a simplified, chainable, and compile-time-safe syntax.","archived":false,"fork":false,"pushed_at":"2025-05-26T15:29:08.000Z","size":830,"stargazers_count":71,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-28T15:42:38.415Z","etag":null,"topics":["carthage","cocoapods","ios","spm","swift","swiftui","test-framework","testing","tvos","ui-testing","uikit","xcode","xctest"],"latest_commit_sha":null,"homepage":"","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/hhru.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-05-13T09:59:25.000Z","updated_at":"2025-06-25T10:51:53.000Z","dependencies_parsed_at":"2025-06-28T15:41:47.798Z","dependency_job_id":null,"html_url":"https://github.com/hhru/Rafinad","commit_stats":null,"previous_names":["hhru/rafinad"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hhru/Rafinad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FRafinad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FRafinad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FRafinad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FRafinad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hhru","download_url":"https://codeload.github.com/hhru/Rafinad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FRafinad/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267701283,"owners_count":24130447,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["carthage","cocoapods","ios","spm","swift","swiftui","test-framework","testing","tvos","ui-testing","uikit","xcode","xctest"],"created_at":"2025-06-06T01:07:31.476Z","updated_at":"2025-07-29T14:10:25.777Z","avatar_url":"https://github.com/hhru.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rafinad\n[![Build Status](https://github.com/hhru/Rafinad/actions/workflows/swift.yml/badge.svg)](https://github.com/hhru/Rafinad/actions)\n[![SPM compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen)](https://swift.org/package-manager/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen)](https://github.com/Carthage/Carthage)\n[![Cocoapods](https://img.shields.io/cocoapods/v/Rafinad)](http://cocoapods.org/pods/Rafinad)\n[![Platforms](https://img.shields.io/cocoapods/p/Rafinad)](https://developer.apple.com/discover/)\n[![Xcode](https://img.shields.io/badge/Xcode-16-blue)](https://developer.apple.com/xcode)\n[![Swift](https://img.shields.io/badge/Swift-5.9-orange)](https://swift.org)\n[![License](https://img.shields.io/github/license/hhru/rafinad)](https://opensource.org/licenses/MIT)\n\nRafinad is a DSL for UI testing of iOS and tvOS apps, featuring a simplified, chainable, and compile-time-safe syntax.\n\n\n## Contents\n- [Requirements](#requirements)\n- [Installation](#installation)\n    - [Swift Package Manager](#swift-package-manager)\n    - [Carthage](#carthage)\n    - [CocoaPods](#cocoapods)\n- [Usage](#usage)\n    - [Quick Start](#quick-start)\n    - [Example App](#example-app)\n- [Communication](#communication)\n- [License](#license)\n\n\n## Requirements\n- iOS 15.0+ / tvOS 15.0+\n- Xcode 16.0+\n- Swift 5.9+\n\n\n## Installation\n\n### Swift Package Manager\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code.\nIt’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\nTo integrate Rafinad into your Xcode project using Swift Package Manager,\nadd it to the `dependencies` value of your `Package.swift` or the Package list in Xcode:\n\n``` swift\n.package(url: \"https://github.com/hhru/Rafinad.git\", from: \"1.0.0\")\n```\n\nThen specify the dependencies for the corresponding targets of your project:\n- `RafinadTesting` for the UI testing target\n- `Rafinad` for both the app target and the UI testing target\n\n\n### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. You can install Carthage with Homebrew using the following command:\n``` bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate Rafinad into your Xcode project using Carthage, specify it in your `Cartfile`:\n``` ogdl\ngithub \"hhru/Rafinad\" ~\u003e 1.0.0\n```\n\nThen run `carthage update  --use-xcframeworks` to build the frameworks.\n\nFinally, drag the built `.xcframework` bundles from the `Carthage/Build` folder into the \"Frameworks and Libraries\" section of your project's corresponding targets:\n- `RafinadTesting.xcframework` for the UI testing target\n- `Rafinad.xcframework` for both the app target and the UI testing target\n\n\n### CocoaPods\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n``` bash\n$ gem install cocoapods\n```\n\nTo integrate Rafinad into your Xcode project using [CocoaPods](http://cocoapods.org), specify its subspecs in your `Podfile`:\n\n``` ruby\nplatform :ios, '15.0'\nuse_frameworks!\n\ntarget '\u003cYour App Target Name\u003e' do\n    pod 'Rafinad/Accessibility', '~\u003e 1.0.0'\nend\n\ntarget '\u003cYour UI Testing Target Name\u003e' do\n    pod 'Rafinad', '~\u003e 1.0.0'\nend\n```\n\nFinally, run the following command:\n\n``` bash\n$ pod install\n```\n\n\n## Usage\n[Documentation](http://tech.hh.ru/Rafinad/documentation/rafinad)\n\n### Quick Start\nLet's walk through a simple example screen, that displays user information.\nFor simplicity, we'll only show the user's name and position.\nTo use Rafinad on this screen in your tests, the first step is to create an accessibility scheme\nby subclassing the base `ScreenAccessibility` class:\n\n``` swift\nimport Rafinad\n\n// Accessibility scheme for the user screen\nclass UserAccessibility: ScreenAccessibility {\n\n    let name = TextAccessibility()\n    let position = TextAccessibility()\n}\n```\n\nNext, set accessibility keys to the components on the screen, using the key-paths from your scheme:\n\n``` swift\nimport SwiftUI\n\nstruct UserView: View {\n\n    let user: User\n\n    var body: some View {\n        VStack(spacing: 4) {\n            Text(user.name)\n                .font(.largeTitle)\n                // Set accessibility key for user name\n                .accessibilityKey(\\UserAccessibility.name)\n\n            Text(user.position)\n                .font(.subheadline)\n                .foregroundStyle(.secondary)\n                // Set accessibility key for user position\n                .accessibilityKey(\\UserAccessibility.position)\n        }\n    }\n}\n```\n\nNow your screen is ready for UI testing. You can write tests as follows:\n\n``` swift\nimport XCTest\nimport RafinadTesting\n\n@MainActor\nfinal class UserScreenTests: XCTestCase {\n\n    let application = XCUIApplication()\n\n    func testThatUserNameIsCorrect() {\n        application.launch()\n\n        application\n            .screen(of: UserAccessibility.self) // get the user screen\n            .name // get the name component\n            .waitForExistence() // wait for component to appear\n            .assert(text: \"Steve Jobs\") // verify name\n    }\n\n    func testThatUserPositionIsCorrect() {\n        application.launch()\n\n        application\n            .screen(of: UserAccessibility.self) // get the user screen\n            .position // get the position component\n            .waitForText(\"CEO\") // wait for position text\n    }\n}\n```\n\n\n### Example App\n[Example app](Example) is a simple iOS and tvOS app that demonstrates how Rafinad works in practice.\nIt's also a good place to start playing with the framework.\n\n\n## Communication\n- If you need help, open an issue.\n- If you found a bug, open an issue.\n- If you have a feature request, open an issue.\n- If you want to contribute, submit a pull request.\n\n📬 Feel free to reach out to us on Telegram. We're here to help: https://t.me/hh_tech\n\n\n## License\nRafinad is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhru%2Frafinad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhhru%2Frafinad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhru%2Frafinad/lists"}