LoadingWheel testTag for every loading wheel

Change-Id: I7728e1717925abdfb607e93f3d48226910d42c0d
pull/475/head
mlykotom 2 years ago
parent 039ec8e959
commit 0018144827

@ -24,7 +24,7 @@ import com.google.samples.apps.nowinandroid.flingElementDownUp
fun MacrobenchmarkScope.forYouWaitForContent() { fun MacrobenchmarkScope.forYouWaitForContent() {
// Wait until content is loaded by checking if topics are loaded // Wait until content is loaded by checking if topics are loaded
device.wait(Until.gone(By.res("forYou:loadingWheel")), 5_000) device.wait(Until.gone(By.res("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 topics to be sure // So we'll wait here for topics to be sure
val obj = device.findObject(By.res("forYou:topicSelection")) val obj = device.findObject(By.res("forYou:topicSelection"))

@ -43,6 +43,7 @@ import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.drawscope.rotate import androidx.compose.ui.graphics.drawscope.rotate
import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -109,6 +110,7 @@ fun NiaLoadingWheel(
.padding(8.dp) .padding(8.dp)
.graphicsLayer { rotationZ = rotationAnim } .graphicsLayer { rotationZ = rotationAnim }
.semantics { contentDescription = contentDesc } .semantics { contentDescription = contentDesc }
.testTag("loadingWheel"),
) { ) {
repeat(NUM_OF_LINES) { index -> repeat(NUM_OF_LINES) { index ->
rotate(degrees = index * 30f) { rotate(degrees = index * 30f) {

@ -204,8 +204,7 @@ internal fun ForYouScreen(
) { ) {
NiaOverlayLoadingWheel( NiaOverlayLoadingWheel(
modifier = Modifier modifier = Modifier
.align(Alignment.Center) .align(Alignment.Center),
.testTag("forYou:loadingWheel"),
contentDesc = loadingContentDescription contentDesc = loadingContentDescription
) )
} }

Loading…
Cancel
Save