Waiting for topic selection

Change-Id: I44226a7c5e693ee92eed27070c09cd4e0751e674
pull/475/head
mlykotom 2 years ago
parent 4ba63c0de8
commit ec6e902c0f

@ -27,8 +27,9 @@ fun MacrobenchmarkScope.forYouWaitForContent() {
device.wait(Until.gone(By.res("forYou:loadingWheel")), 5_000) device.wait(Until.gone(By.res("forYou:loadingWheel")), 5_000)
// Sometimes, the loading wheel is gone, but the content is not loaded yet // Sometimes, the loading wheel is gone, but the content is not loaded yet
// So we'll wait here for authors to be sure // So we'll wait here for authors to be sure
val obj = device.findObject(By.res("forYou:authors")) val obj = device.findObject(By.res("forYou:topicSelection"))
obj.wait(untilHasChildren(), 30_000) // Timeout here is quite big, because sometimes data loading takes a long time!
obj.wait(untilHasChildren(), 60_000)
} }
fun MacrobenchmarkScope.forYouScrollFeedDownUp() { fun MacrobenchmarkScope.forYouScrollFeedDownUp() {

@ -282,7 +282,9 @@ private fun TopicSelection(
modifier: Modifier = Modifier modifier: Modifier = Modifier
) = trace("TopicSelection") { ) = trace("TopicSelection") {
val lazyGridState = rememberLazyGridState() val lazyGridState = rememberLazyGridState()
TrackScrollJank(scrollableState = lazyGridState, stateName = "forYou:TopicSelection") val topicSelectionTestTag = "forYou:topicSelection"
TrackScrollJank(scrollableState = lazyGridState, stateName = topicSelectionTestTag)
LazyHorizontalGrid( LazyHorizontalGrid(
state = lazyGridState, state = lazyGridState,
@ -302,6 +304,7 @@ private fun TopicSelection(
// The maximum of these two bounds is therefore a valid upper bound in all cases. // The maximum of these two bounds is therefore a valid upper bound in all cases.
.heightIn(max = max(240.dp, with(LocalDensity.current) { 240.sp.toDp() })) .heightIn(max = max(240.dp, with(LocalDensity.current) { 240.sp.toDp() }))
.fillMaxWidth() .fillMaxWidth()
.testTag(topicSelectionTestTag)
) { ) {
items(onboardingUiState.topics) { items(onboardingUiState.topics) {
SingleTopicButton( SingleTopicButton(

Loading…
Cancel
Save