{"id":17801208,"url":"https://github.com/brunomazzo/uiunittest","last_synced_at":"2025-10-19T00:06:01.205Z","repository":{"id":141402217,"uuid":"609699180","full_name":"BrunoMazzo/UIUnitTest","owner":"BrunoMazzo","description":"Run UI XCTest commands from your unit test","archived":false,"fork":false,"pushed_at":"2024-10-29T11:28:23.000Z","size":340284,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-29T13:22:51.181Z","etag":null,"topics":["ios","swiftui","ui-test","uikit","unit-test"],"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/BrunoMazzo.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}},"created_at":"2023-03-05T00:36:29.000Z","updated_at":"2024-10-07T11:13:06.000Z","dependencies_parsed_at":"2023-07-25T15:16:48.796Z","dependency_job_id":"4cf37fcc-d76a-4a7e-89ad-4913d32f102b","html_url":"https://github.com/BrunoMazzo/UIUnitTest","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoMazzo%2FUIUnitTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoMazzo%2FUIUnitTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoMazzo%2FUIUnitTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoMazzo%2FUIUnitTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrunoMazzo","download_url":"https://codeload.github.com/BrunoMazzo/UIUnitTest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234084255,"owners_count":18777183,"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":["ios","swiftui","ui-test","uikit","unit-test"],"created_at":"2024-10-27T12:35:01.439Z","updated_at":"2025-09-24T13:31:20.694Z","avatar_url":"https://github.com/BrunoMazzo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIUnitTest\n\nRun XCTest UI commands from your unit test.\n\n## How it works\n\nWhen you run an UI test, Apple runs two processes: the UI test process and the app process. The UI test process is the one that runs your test code and the app process is the one that runs your full app. Because these two are different process, you lose the ability to modify your app state from your test code. UIUnitTest solves this problem by running your unit test instead of the app, and running the UI test process with a server to receives commands from your unit test code and execute them.\n\n## Installation\n\n1. Install the package:\n\n```swift\n.package(url: \"git@github.com:BrunoMazzo/UIUnitTest.git\", from: \"0.4.0\")\n```\n\n2. Add it to your Unit test target\n\n3. Add a server start on your test scheme pre action:\n\n   3.1 Select your test target on `Provide build settings from`\n   \n   3.2 Add the command: \n    ```shell\n    \n    $BUILD_DIR/../../SourcePackages/checkouts/UIUnitTest/start-server.sh\n    ```\n\n    ![Pre action panel](docs/pre-action.png)\n\n    3.3 Add post action to stop the server:\n    ```shell\n    \n    $BUILD_DIR/../../SourcePackages/checkouts/UIUnitTest/stop-server.sh\n    ```\n\n4. Start coding\n\n\n## Usage\n\n```swift\n\nimport UIUnitTest\n\n...\n\n@MainActor\nfunc testExample() {\n    let app = App()\n\n    let viewYouWantToTest = YourSwiftUIView(...) // or UIViewController\n\n    showView(viewYouWantToTest)\n    \n    app.button(identifier: \"some button identifier\").tap()\n\n    ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunomazzo%2Fuiunittest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunomazzo%2Fuiunittest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunomazzo%2Fuiunittest/lists"}