{"id":22915201,"url":"https://github.com/joshludahl/elk","last_synced_at":"2026-04-30T00:08:30.195Z","repository":{"id":99862674,"uuid":"281563735","full_name":"JoshLudahl/ELK","owner":"JoshLudahl","description":"Espresso Extension library written in Kotlin","archived":false,"fork":false,"pushed_at":"2023-09-29T23:55:33.000Z","size":290,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-01T12:09:19.806Z","etag":null,"topics":["android","espresso","intents","kotlin","library","recyclerview","test-automation","ui-automated-tests"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/JoshLudahl.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}},"created_at":"2020-07-22T03:23:40.000Z","updated_at":"2021-11-14T05:21:05.000Z","dependencies_parsed_at":"2023-05-10T19:45:27.383Z","dependency_job_id":null,"html_url":"https://github.com/JoshLudahl/ELK","commit_stats":null,"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/JoshLudahl/ELK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshLudahl%2FELK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshLudahl%2FELK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshLudahl%2FELK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshLudahl%2FELK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoshLudahl","download_url":"https://codeload.github.com/JoshLudahl/ELK/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshLudahl%2FELK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","espresso","intents","kotlin","library","recyclerview","test-automation","ui-automated-tests"],"created_at":"2024-12-14T05:19:30.128Z","updated_at":"2026-04-30T00:08:30.181Z","avatar_url":"https://github.com/JoshLudahl.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://jitpack.io/v/JoshLudahl/ELK.svg)](https://jitpack.io/#JoshLudahl/ELK) [![Android CI](https://github.com/JoshLudahl/ELK/actions/workflows/android.yml/badge.svg)](https://github.com/JoshLudahl/ELK/actions/workflows/android.yml)\n# ELK\n## Espresso Extension library written in Kotlin\nA simple extension library for Espresso with support for the page object design, or in this case, the Robot Pattern. This library is growing and more features to come.  There are a few ways to perform different actions and assertions as well as matching objects.\n\n# Note\nThis library will not be maintained going forward. With Jetpack Compose, please see [CAT](https://github.com/JoshLudahl/CAT), Compose for Android Testing. Look, I just wanted to use CAT, it's okay.\n\n### Get started\nTo include the library, add the following to your app module build.gradle file:\n```groovy\ndependencies {\n    androidTestImplementation \"com.github.JoshLudahl:ELK:$elk_version\"\n}\n```\nAnd be sure to include jitpack in the repositories:\n```groovy\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n```\n\n### Simple infix notation to simplify code expression\nClicking on an object is easy:\n```kotlin\nclick on view(R.id.id_resource)\n```\n\nType text into a TextView:\n```kotlin\ntype text(\"text\") into(R.id.textview_item)\n```\n\nBasic assertions are human readable:\n```kotlin\nview(R.id.id_resource) confirm isDisplayed\n```\n\nSimple extension to check if something isn't in a state:\n```kotlin\nview(R.id.id_resource) confirm isDisplayed.not()\n```\n\nA simple replacement for onView(allOf(...)):\n```kotlin\nview(\n    view(\"Text to check\"),\n    view(R.id.id_resource_to_check),\n    view(R.string.string_resource_to_check)\n)\n```\n\n`view` is a powerhouse replacement for `onView(withId(R.id.some_id))`, `onView(withText(R.string.some_text))`, `onView(withId(\"a string literal\"))`\nor even `onView(allOf(...))`:\n```kotlin\nview(\"Text to check\") //String Literal matcher\nview(R.id.id_resource_to_check) //Id resource matcher\nview(R.string.string_resource_to_check) //String resource matcher\nview(TextView::class.java) //Class matcher\n\nview(\n    view(\"Text to check\"),\n    view(R.id.id_resource_to_check),\n    view(R.string.string_resource_to_check)\n) // simplification matcher for onView(allOf(...))\n```\n\n### Multiple ways to check views\nA simple, bulk check:\n```kotlin\nviewsAreDisplayed(\n    view(\"Text to check\"),\n    view(R.id.id_resource_to_check),\n    view(R.string.string_resource_to_check)\n)\n```\n\n### Extensions utilize both ViewInteractions, Matchers, and some sugar syntax utilizing Kotlin's infix notation\nFor example ViewMatchers.isDisplayed() can be used as part of a ViewInteraction, Matcher, or as part of an assertion:\n```kotlin\nview(id) check isDisplayed\nonView(withId(id)).isDisplayed()\nwithId(id).isDisplayed()\nR.id.id_resource.isDisplayed()\n```\nThis allows for flexibility, so you can customize how your testing library looks and feels. \n\n### Custom View Matchers will help find elements easier\nA regular expression helper function:\n```kotlin\nfun checker() {\n    view(R.id.resource_id).withPattern(\"\\\\+d\")\n}\n```\nCheck the theme mode for dark or light mode:\n```kotlin\nfun checker() {\n    view(isRoot()).withMode(Configuration.UI_MODE_NIGHT_YES)\n}\n```\nWhich checks the provided mode against the system mode and will return true if they match.\n\n### Annotations out of the box for Gherkin support and code separation\nGherkin usage:\n```kotlin\nfun simpleCheck() {\n    @Given(\"I am on the home page\")\n    @And(\"I am not logged in\")\n    @When(\"I click on the login link\")\n    @Then(\"I am taken to the login page\")\n}\n```\n\nSeparate Production, Development, and Local tests:\n```kotlin\n@Development\n@Test\nfun checkSomething() {\n//...\n}\n\n@Production\n@Test\nfun checkSomething() {\n//...\n}\n\n@Local\n@Test\nfun checkSomething() {\n//...\n}\n```\nThen just use a runner or command argument to exclude the desired tests:\n```groovy\ntestInstrumentationRunnerArgument \"notAnnotation\", \"com.android.elk.common.Production\"\n```\n\nA generic TestId annotation which takes in a vararg integer:\n```kotlin\n@Test\n@TestId(12345) // could take in zero or many integers\nfun checkSomething() { \n//...\n}\n```\n\n### RecyclerView\nVarious RecyclerView extensions, still working to make them simpler to use.\n\n### Checking Toasts is easy\nSimply call the toastMatcher function with the expected string or string resource:\n```kotlin\ntoastMatcher(\"My Message\")\ntoastMatcher(R.string.toast_message)\n```\n\n### Changing orientation is easy\nCall the Espresso orientation changer:\n```kotlin\nrotateOrientationToLandscape()\nrotateOrientationToPortrait()\ntoggleOrientation()\n``` \n\n### Includes an Espresso setup rule\nIncluded in the setup is the Intents, Idling Resources, and DataBindingIdlingResource registering and unregistering.\nIncludes the suggested IdlingResource class from Android, which you can copy to your production code if you want to use it.\n\nTo use, set the rule up and send your activity rule as a parameter:\n```kotlin\n@get:Rule\nval espressoSetupRule = EspressoSetupRule(activityRule)\n```\nIf used, it will register/unregister:\n* IdlingResources\n* DataBindingIdlingResources\n* Intents\n\n### Test Configuration and Utilities\nSimple utility functions for accessing configurations such as string resources:\n```kotlin\ncontext stringOf id.string.some_string\n```\n\nAssets:\n```kotlin\nassets\n```\n\nInstrumentation:\n```kotlin\ninstrumentation\n```\nSimple, but useful way to easily get access to the applications configuration.\n\n### Support for the Robot Pattern\nYou can use the Robot Pattern in your tests.  A generic Robot class has been provided, so you can use syntax like:\n```kotlin\nscreen\u003cScreenObjectClass\u003e {\n    screenObjectClassFunctions()\n}\n\nverify\u003cScreenObjectClass\u003e {\n    screenObjectClassFunctions()\n}\n\n```\nIt does require Kotlin's reflection library:\n```groovy\ndependencies {\n    implementation \"org.jetbrains.kotlin:kotlin-reflect:$version\"\n}\n```\n\n### Disclaimer\nThis project is under development and is not suggested for production development at this time.  Mostly used as a means to learn Kotlin. :)\n\n### License\nMIT License\n\nCopyright (c) 2020 Josh Ludahl\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshludahl%2Felk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshludahl%2Felk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshludahl%2Felk/lists"}