{"id":19587195,"url":"https://github.com/leocolman/kotest-android","last_synced_at":"2025-10-08T08:49:18.218Z","repository":{"id":197077816,"uuid":"625035647","full_name":"LeoColman/kotest-android","owner":"LeoColman","description":"Runner, assertions and extensions to run Android Instrumented Tests using Kotest","archived":false,"fork":false,"pushed_at":"2025-08-31T09:09:20.000Z","size":260,"stargazers_count":29,"open_issues_count":17,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-31T11:22:49.104Z","etag":null,"topics":["android","hacktoberfest","kotest","kotest-assertions"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/LeoColman.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-07T22:23:28.000Z","updated_at":"2025-08-03T09:20:14.000Z","dependencies_parsed_at":"2024-11-11T08:02:36.029Z","dependency_job_id":"7a7e9a46-96c0-4038-91ab-c69f990b7e0c","html_url":"https://github.com/LeoColman/kotest-android","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":0.3846153846153846,"last_synced_commit":"06a78c53f9706945180e04456e79847089386aaa"},"previous_names":["leocolman/kotest-android"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/LeoColman/kotest-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoColman%2Fkotest-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoColman%2Fkotest-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoColman%2Fkotest-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoColman%2Fkotest-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeoColman","download_url":"https://codeload.github.com/LeoColman/kotest-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoColman%2Fkotest-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278916437,"owners_count":26068090,"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-10-08T02:00:06.501Z","response_time":56,"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":["android","hacktoberfest","kotest","kotest-assertions"],"created_at":"2024-11-11T08:02:23.766Z","updated_at":"2025-10-08T08:49:18.191Z","avatar_url":"https://github.com/LeoColman.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotest Android\n\n[![License](https://img.shields.io/github/license/LeoColman/kotest-android)](LICENSE)\n![Maintenance](https://img.shields.io/maintenance/yes/2025)\n[![Kotest Repository](https://img.shields.io/badge/Kotest-kotest.io-green)](https://kotest.io/)\n\nUnofficial integration between the [Kotest Framework](https://kotest.io) and\nthe [Android Platform](https://developer.android.com/docs). This repository aims to contain the tools necessary to run\nKotest in the complicated Android environment, with [`kotest-runner-android`](#kotest-runner-android) - a customized\nversion\nof [`kotest-runner-junit4`](https://github.com/kotest/kotest/tree/master/kotest-runner/kotest-runner-junit4) - [`kotest-assertions-android`](#kotest-assertions-android)\ncontaining matchers and assertions specific to Android\n\n----\n\n## Kotest Runner Android\n\n![Maven Central](https://img.shields.io/maven-central/v/br.com.colman/kotest-runner-android)\n\nA custom version\nof [`kotest-runner-junit4`](https://github.com/kotest/kotest/tree/master/kotest-runner/kotest-runner-junit4) made\nspecifically to run Android Integration Tests.\n\n### Adding the Runner to an Android Project\n\nThe SubProject [kotest-runner-android-tests](kotest-runner-android/kotest-runner-android-tests) should provide a good\nsample if you need one.\n\n#### Android Block Configuration\n\nIn the Android Block of your `build.gradle.kts` you need to ensure that the `testInstrumentationRunner` is set\nto `\"androidx.test.runner.AndroidJUnitRunner\"`. Yes, the default runner is what we will leverage to run our tests.\n\n```kotlin\nandroid {\n    defaultConfig {\n        // ...\n        testInstrumentationRunner = \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n}\n```\n\n#### Dependencies Configuration\n\nTo `androidTestImplementation` we are going to add `kotest-runner-android`:\n\n```kotlin\n  androidTestImplementation(\"br.com.colman:kotest-runner-android:VERSION\")\n```\n\n## Kotest Extensions Android\n![Maven Central](https://img.shields.io/maven-central/v/br.com.colman/kotest-extensions-android)\n\n#### Dependencies Configuration\nTo `testImplementation` we are going to add `kotest-extensions-android`:\n\n```kotlin\n  testImplementation(\"br.com.colman:kotest-extensions-android:VERSION\")\n```\n\n#### Available Extensions\n\n##### Robolectric Extension\n\nThe Robolectric Extension enables tests to operate under the [Robolectric](https://robolectric.org/) environment. To\nutilize this feature, adorn the unit tests that you wish to run with Robolectric with the `@RobolectricTest` annotation.\nTests will be executed within the integrated Robolectric environment. `@Config` annotations can be used for Robolectric\nspecific configurations.\n\nHere is a Kotlin example of how to use the annotation:\n\n```kotlin\n@RobolectricTest(sdk = Build.VERSION_CODES.O)\nclass ContainedRobolectricRunnerMergeApiVersionTest {\n  init {\n    \"Get the Build.VERSION_CODES.O\" {\n      Build.VERSION.SDK_INT shouldBe Build.VERSION_CODES.O\n    }\n  }\n}\n```\n\n\n\n## Kotest Assertions Android\n\n![Maven Central](https://img.shields.io/maven-central/v/br.com.colman/kotest-assertions-android)\n\n#### Dependencies Configuration\n\nTo `androidTestImplementation` we are going to add `kotest-assertions-android`:\n\n```kotlin\n  androidTestImplementation(\"br.com.colman:kotest-assertions-android:VERSION\")\n```\n\n#### Available Matchers\n\nDocumentation and format to be improved.\n\n\n\u003cdetails\u003e\n\u003csummary\u003eOpen Spoiler for Details\u003c/summary\u003e\n\n| View                                      |                                                          |\n|-------------------------------------------|----------------------------------------------------------|\n| `view.shouldBeVisible()`                  | Asserts that the view visibility is VISIBLE              |\n| `view.shouldBeInvisible()`                | Asserts that the view visibility is INVISIBLE            |\n| `view.shouldBeGone()`                     | Asserts that the view visibility is GONE                 |\n| `view.shouldHaveContentDescription()`     | Asserts that the view has any content description        |\n| `view.shouldHaveContentDescription(desc)` | Asserts that the view has `desc` as Content Description  |\n| `view.shouldHaveTag(key, value)`          | Asserts that the view has a tag `key` with value `value` |\n| `view.shouldHaveTag(any)`                 | Asserts that the view's tag is `any`                     |\n| `view.shouldBeEnabled()`                  | Asserts that the view is enabled                         |\n| `view.shouldBeFocused()`                  | Asserts that the view has focus                          |\n| `view.shouldBeFocusable()`                | Asserts that the view is focusable                       |\n| `view.shouldBeFocusableInTouchMode()`     | Asserts that the view is focusable in touch mode         |\n| `view.shouldBeClickable()`                | Asserts that the view is clickable                       |\n| `view.shouldBeLongClickable()`            | Asserts that the view is long clickable                  |\n\n| TextView                                |                                                                  |\n|-----------------------------------------|------------------------------------------------------------------|\n| `tv.shouldHaveText(text)`               | Asserts that the text view has text `text`                       |\n| `tv.shouldHaveTextColorId(id)`          | Asserts that the text color is the same from color resource `id` |\n| `tv.shouldHaveTextColor(colorInt)`      | Asserts that the text color is `colorInt`                        |\n| `tv.shouldBeAllCaps()`                  | Asserts that the textview is marked with the `isAllCaps` flag    |\n| `tv.shouldHaveTextAlignment(alignment)` | Asserts that the text alignment is `alignment`                   |\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocolman%2Fkotest-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleocolman%2Fkotest-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocolman%2Fkotest-android/lists"}