Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #2480: Work around for espresso tests in ExplorationActivityTest #2777

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ import org.oppia.android.domain.topic.TEST_TOPIC_ID_0
import org.oppia.android.testing.EditTextInputAction
import org.oppia.android.testing.IsOnRobolectric
import org.oppia.android.testing.RobolectricModule
import org.oppia.android.testing.RunOn
import org.oppia.android.testing.TestAccessibilityModule
import org.oppia.android.testing.TestCoroutineDispatchers
import org.oppia.android.testing.TestDispatcherModule
import org.oppia.android.testing.TestLogReportingModule
import org.oppia.android.testing.TestPlatform
import org.oppia.android.testing.time.FakeOppiaClockModule
import org.oppia.android.util.caching.testing.CachingTestModule
import org.oppia.android.util.gcsresource.GcsResourceModule
Expand Down Expand Up @@ -524,8 +526,8 @@ class ExplorationActivityTest {

// TODO (#1855): Resolve ktlint max line in app module test
// TODO(#89): The ExplorationActivity takes time to finish. This test case is failing currently.
@RunOn(TestPlatform.ESPRESSO)
@Test
@Ignore("The ExplorationActivity takes time to finish, needs to fixed in #89.")
fun testAudioWithWifi_openRatioExploration_clickAudioIcon_checkAudioFragmentHasDefaultLanguageAndAutoPlays() { // ktlint-disable max-line-length
getApplicationDependencies(RATIOS_EXPLORATION_ID_0)
networkConnectionUtil.setCurrentConnectionStatus(NetworkConnectionUtil.ConnectionStatus.LOCAL)
Expand All @@ -537,6 +539,9 @@ class ExplorationActivityTest {
RATIOS_EXPLORATION_ID_0
)
).use {
// Work around for #2430 espresso tests, resource registered again at the end of test
testCoroutineDispatchers.unregisterIdlingResource()

waitForTheView(withText("What is a Ratio?"))
onView(withId(R.id.action_audio_player)).perform(click())
onView(
Expand All @@ -554,6 +559,7 @@ class ExplorationActivityTest {
)
)
)
testCoroutineDispatchers.registerIdlingResource()
}
explorationDataController.stopPlayingExploration()
}
Expand Down