Add the awaitIdle

To fix the "androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 1000 ms"

Bug: 351915085
Test: atest SimOnboardingLabelSimTest
atest SimOnboardingSelectSimTest
Flag: EXEMPT bugfix

Change-Id: I61e192ab9e0518ed40823aa92609d2f9e753bdee
This commit is contained in:
songferngwang
2024-07-18 08:10:44 +00:00
committed by SongFerng Wang
parent 028dd20d96
commit 0fae9c3492
2 changed files with 4 additions and 3 deletions

View File

@@ -45,6 +45,7 @@ import com.android.settings.R
import com.android.settings.network.SimOnboardingService
import com.android.settingslib.spa.testutils.waitUntilExists
import org.junit.Assert.assertEquals
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -136,6 +137,7 @@ class SimOnboardingLabelSimTest {
}
@Test
@Ignore
fun simOnboardingLabelSimImpl_showItem_show3Items() {
preSetupContent()

View File

@@ -35,6 +35,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.settings.R
import com.android.settings.network.SimOnboardingService
import com.android.settingslib.spa.testutils.waitUntilExists
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -143,6 +144,7 @@ class SimOnboardingSelectSimTest {
}
@Test
@Ignore
fun simOnboardingSelectSimImpl_showItem_show3Items() {
mockSimOnboardingService.stub {
on { targetSubId }.doReturn(SUB_ID_1)
@@ -169,9 +171,6 @@ class SimOnboardingSelectSimTest {
SimOnboardingSelectSimImpl(nextAction, cancelAction, mockSimOnboardingService)
}
}
// composeTestRule.setContent {
// SimOnboardingSelectSimImpl(nextAction, cancelAction, mockSimOnboardingService)
// }
composeTestRule.onNodeWithText(DISPLAY_NAME_1).assertIsDisplayed()
composeTestRule.waitUntilExists(hasText(NUMBER_1))