0

Is there a way to run tests with androidx.compose.ui.test interactively (i.e., so that I can see them running with my own eyes)? I’m having trouble with something and it would help to be able to see the UI as the test is trying to execute.

I tried adding a long Thread.sleep in case the test was running so quickly I never got to see anything, but still can't see the UI with a long sleep.

Thanks.

Marc Fearby
  • 1,305
  • 1
  • 13
  • 28

1 Answers1

1

At least for now, it is not possible to see the UI when using androidx.compose.ui.test, since it tests Compose logic without window management.

However, there is an internal Compose Desktop API available that allows running tests with Swing window management. Please note that this API is not officially exposed as Swing is considered an implementation detail. Nevertheless, you can try using this approach by copying the code (taking the license into account). This may provide a way to see the UI.

  • Thanks for that. I can patiently wait for this to evolve into something publicly accessible. Good to know it's possibly on the radar. – Marc Fearby Jul 01 '23 at 00:39