Skip to main content
Answered

Compose Semantics for Android UI tests

  • August 12, 2024
  • 1 reply
  • 31 views

Hi.
I’m trying to write Android UI tests on the app with Intercom integrated.
I’d like to check that Intercom main screen is opened after some actions made in our UI.

However I’ve discovered, that Intercom uses Compose, that’s why usual techniques to find views ids are not working.
Could you suggest if any semantics were used in your Compose code or how can I find any stable identifiers to check them in my tests?

Best answer by mateusz.leszkiewicz

Hi Andrei Beriukhov, It’s Mat from the Support Engineering Team 😀


You can try to add your own semantics to the Compose components in your app for testing purposes. Use the Modifier.semantics function to attach test tags or labels to elements, which you can then reference in your UI tests.

If not please reach out to us via Messenger and we connect you with our Engineers to look into this further.

View original
Did this topic help you find an answer to your question?

1 reply

mateusz.leszkiewicz
Intercom Team
Forum|alt.badge.img+5

Hi Andrei Beriukhov, It’s Mat from the Support Engineering Team 😀


You can try to add your own semantics to the Compose components in your app for testing purposes. Use the Modifier.semantics function to attach test tags or labels to elements, which you can then reference in your UI tests.

If not please reach out to us via Messenger and we connect you with our Engineers to look into this further.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings