Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit c9cc146

Browse files
committed
Temporary fix to the codelab test
Change-Id: Ie12aaf8caffe84d7e27994e54824fbd0bdf9a960
1 parent e973521 commit c9cc146

File tree

1 file changed

+5
-0
lines changed
  • mobile/src/androidTest/java/com/google/samples/apps/iosched/tests/ui

1 file changed

+5
-0
lines changed

mobile/src/androidTest/java/com/google/samples/apps/iosched/tests/ui/CodelabTest.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ import com.google.samples.apps.iosched.shared.data.FakeConferenceDataSource
2929
import com.google.samples.apps.iosched.tests.SetPreferencesRule
3030
import dagger.hilt.android.testing.HiltAndroidRule
3131
import dagger.hilt.android.testing.HiltAndroidTest
32+
import kotlinx.coroutines.Dispatchers
33+
import kotlinx.coroutines.test.TestCoroutineDispatcher
34+
import kotlinx.coroutines.test.setMain
3235
import org.hamcrest.CoreMatchers.allOf
3336
import org.hamcrest.CoreMatchers.instanceOf
37+
import org.junit.Before
3438
import org.junit.Rule
3539
import org.junit.Test
3640
import org.junit.runner.RunWith
@@ -55,6 +59,7 @@ class CodelabTest {
5559
onView(allOf(instanceOf(TextView::class.java), withParent(withId(R.id.toolbar))))
5660
.check(matches(withText(R.string.event_codelabs_title)))
5761
// One of the codelabs
62+
Thread.sleep(400) // TODO: RecyclerView is async so it makes the test fail
5863
onView(withText(FakeConferenceDataSource.FAKE_CODELAB_TITLE)).check(matches(isDisplayed()))
5964
}
6065
}

0 commit comments

Comments
 (0)