Hello everyone :wave::skin-tone-5:. while testing...
# compose
d
Hello everyone 👋🏾. while testing out compose on our project, we realised that our ui testing framework (Appium) uses view ids to run tests on the UI. is there a way to specify ids for composables. I also read about the compose semantics tree but I'm not sure how it can help. Thanks 🙏🏾
asides id, how can one uniquely identify a composable in a given screen
k
If you search this channel, you might find same questions. Usually I do believe you'll have to find your composable based on text, contentDescription or tag.
d
You can set a
Modifier.testTag(...)
.
c
You can also assign an ID via
Modifier.layoutId
z
testTag
is the compose replacement for view IDs for the testing use case.
layoutID
has nothing to do with view ID so probably won't help you here. There have definitely been discussions about Appium in this channel but I don't remember what the solutions people found were.
👍 2