ajoz
06/04/2024, 2:12 PMtestTag . We have a Composable that gets data from two different sources (flows) as state. In case of debug/release builds everything works fine. The problem starts appearing only when running Espresso (Compose Android Test Rule). When the test is run some of the state is omitted and the changes to the state do not cause any recompositions, even though when running on release/debug it works fine.
We managed to pinpoint the problem (which we still have troubles with believing) to the testTag for one of the components that are displaying the data from the states. Removing the testTag corrects the problem and everything works fine. Adding it back reintroduces the issue.
As much as it sounds silly, we would like to understand why is it happening. What sorts of things the semantics is adding that the testTag could have such a result? Do you have any experiences with this?Zach Klippenstein (he/him) [MOD]
06/04/2024, 6:16 PMajoz
06/04/2024, 6:18 PMajoz
06/04/2024, 6:28 PMsemantics Modifier with things like role, contentDescription or stateDescription does not have any impact. Still adding the testTag has. Regardless if added in the semantics block or through the convenience method called testTag(String)