{"id":20325431,"url":"https://github.com/getyourguide/uitestglaze","last_synced_at":"2025-05-08T01:30:45.060Z","repository":{"id":143349247,"uuid":"607206547","full_name":"getyourguide/UiTestGlaze","owner":"getyourguide","description":"Reliable and effortless Android UI tests","archived":false,"fork":false,"pushed_at":"2024-05-06T06:37:02.000Z","size":299,"stargazers_count":31,"open_issues_count":5,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-06-06T11:27:36.693Z","etag":null,"topics":["android","compose","e2e-testing","jetpack","testing","ui-testing"],"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/getyourguide.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-27T14:32:54.000Z","updated_at":"2024-01-20T21:32:51.000Z","dependencies_parsed_at":"2023-06-09T23:01:12.964Z","dependency_job_id":"628cd44f-bbfa-4874-9149-747c59e97000","html_url":"https://github.com/getyourguide/UiTestGlaze","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2FUiTestGlaze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2FUiTestGlaze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2FUiTestGlaze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2FUiTestGlaze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getyourguide","download_url":"https://codeload.github.com/getyourguide/UiTestGlaze/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224682695,"owners_count":17352396,"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":["android","compose","e2e-testing","jetpack","testing","ui-testing"],"created_at":"2024-11-14T19:39:49.156Z","updated_at":"2024-11-14T19:39:49.836Z","avatar_url":"https://github.com/getyourguide.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UiTestGlaze 🍰\nAre you tired of dealing with flaky, time-consuming unreadable Android UI tests?\n\nUiTestGlaze offers stable and effortless testing, making the process enjoyable again. With a focus on readability and ease of use, UiTestGlaze is the perfect solution for your UI testing needs. Whether you want to use it for an entire test or just certain parts, UiTestGlaze has you covered. Don't waste any more time on frustrating UI tests.\n\n## Download\nImport UiTestGlaze as a testing dependency:\n\n```gradle\nandroidTestImplementation('io.github.getyourguide:uitestglaze:LATEST_VERSION')\n```\n\n## API\n\n### Config\nUiTestGlaze accepts a `Config` option. With this config it's possible to define the log level, timeouts and provide loading views. When UiTestGlaze detects a provided loading view it will automatically wait till the loading view is gone. Of course, you can also define a timeout how long UiTestGlaze should wait till an error is thrown. E.g.:\n\n```kotlin\nUiTestGlaze(config = UiTestGlaze.Config(\n\t\tloadingResourceIds = listOf(R.id.loading_view),\n\t\twaitTillLoadingViewsGoneTimeout = 30.seconds\n\t)\n)\n```\n\n### Tap\nTap on an element with the text `\"Click me\"`:\n\n```kotlin\nUiTestGlaze().tap(UiElementIdentifier.Text(\"Click me\"))\n```\n\nor with the id `R.id.click_me`\n\n```kotlin\nUiTestGlaze().tap(UiElementIdentifier.Id(R.id.click_me))\n```\nIt's also possible to use the following *UiElementIdentifier* to find a view:\n\n- **TestTag**. Mainly used to find Jetpack Compose views. Check [this](https://developer.android.com/jetpack/compose/testing#uiautomator-interop) documentation for further information.\n- **TextResource**. If you don't want to use hardcoded strings and prefer to use a string resource.\n- **TextRegex**. Use Regex to find a view.\n- **ChildFrom**. To specify where to search for a view.\n\n### Scroll\nScroll vertically inside a recycler list with id `R.id.recycler_list`:\n\n```kotlin\nUiTestGlaze().scroll(ScrollOption.VerticalDown(UiElement.Id(R.id.recycler_list)))\n```\n\nScroll vertically to the UI element with text `\"Find me!\"`:\n\n```kotlin\nUiTestGlaze().scroll(\n\tScrollOption.VerticalDownToElement(\n\t\ttoUiElement = UiElementIdentifier.Text(\"Find me!\"),\n\t\tinUiElementId = UiElementIdentifier.Id(R.id.recycler_list))\n)\n```\n\n*ScrollOption* also provides the following options:\n\n- **HorizontalRight**. For horizontal scrollable views.\n- **Manual**. To completely specify how the UI should be scrolled.\n- **HorizontalRightToElement**. Scroll horizontally to a given view.\n\n### Assert\nAssert view with id `R.id.visible` is visible:\n\n```kotlin\nUiTestGlaze().assert(assertion = Assertion.Visible(UiElement.Id(R.id.visible)), optional = false)\n```\n\nAssert view with id `R.id.visible` is not visible:\n\n```kotlin\nUiTestGlaze().assert(assertion = Assertion.NotVisible(UiElement.Id(R.id.visible)), optional = false)\n```\n\nFurther *Assertion* options are:\n\n- **Checked**. If a view (e.g., a checkbox) is checked.\n- **NotChecked**. If a view (e.g., a checkbox) is not checked. \n- **Enabled**. If a view (e.g., a button) is enabled.\n- **NotEnabled**. If a view (e.g., a button) is not enabled.\n\n### Enter text\nEnter `\"Hello World!\"` into a text field with id `R.id.text_field`:\n\n```kotlin\nUiTestGlaze().inputText(text = \"Hello World!\", uiElementIdentifier = UiElementIdentifier.Id(R.id.text_field))\n```\nThe same *UiElementIdentifier* described in the *Tap* section is also useable here.\n\n### Press Key\nPress a back key:\n\n```kotlin\nUiTestGlaze().pressKey(PressKey.Back)\n```\nThe following keys can be pressed:\n\n- **Enter**\n- **Backspace**\n- **Home**\n- **Lock**\n- **VolumeUp**\n- **VolumeDown**\n\n### Find a view\nIt's possible to find a view. The result will contain the UiElement's children, the text, resourceId and more.\n\n```kotlin\nUiTestGlaze().find(UiElementIdentifier.Id(R.id.list, true))\n```\n\n### Something is missing or not working?\nSubmit an [Issue](https://github.com/getyourguide/UiTestGlaze/issues/new)!\n\n## License\n\n```\nCopyright 2023 GetYourGuide\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetyourguide%2Fuitestglaze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetyourguide%2Fuitestglaze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetyourguide%2Fuitestglaze/lists"}