Olivier Patry
10/03/2024, 7:01 PMAndroidComposeTestRule
, I'm trying a basic E2E scenario on my app.
The main content stays blank (I get top app bar, bottom nav etc.) until the test finishes, despite using the waitUntil*
helpers.
I have 2 steps in the start sequence to load content: null
(loading), then List<T>
(empty or not), the first step remains until test end but never change before that.
The state relies on a Room database Flow
from a Dao
.
What could prevent the Room flow mechanism to operate in the context of Compose UI tests?Olivier Patry
10/03/2024, 7:04 PMval content by viewModel.content.collectAsState(null)
Olivier Patry
10/03/2024, 7:09 PM= runTest {}
around the test solves the issue…
I'm not sure I spotted that anywhere, but might be logical if Room behavior is tweaked in test context (which feels a bit weird for E2E maybe, no?)CLOVIS
10/08/2024, 10:28 PMOlivier Patry
10/09/2024, 6:20 AMrunTest{}
solved the issue as answered to myself.
Totally linked to #C0NBD4UF8 IMO even if, yes, linked to #C1CFAFJSK as well.CLOVIS
10/09/2024, 7:26 AMOlivier Patry
10/09/2024, 7:28 AM