From d9c3f7722d89e316bc7f892f2d9e0cd065ded6e6 Mon Sep 17 00:00:00 2001 From: "Mr. 17" Date: Tue, 17 Oct 2023 21:12:25 +0530 Subject: [PATCH] Fixes test --- .../exploration/ExplorationActivityTest.kt | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt index 165f250bde4..b880820318e 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt @@ -1078,9 +1078,7 @@ class ExplorationActivityTest { explorationDataController.stopPlayingExploration(isCompletion = false) } - // TODO(#89): The ExplorationActivity takes time to finish. This test case is failing currently. @Test - @Ignore("The ExplorationActivity takes time to finish, needs to fixed in #89.") fun testAudioWifi_ratioExp_audioIcon_audioFragHasDefaultLangAndAutoPlays() { getApplicationDependencies( internalProfileId, @@ -1088,7 +1086,6 @@ class ExplorationActivityTest { RATIOS_STORY_ID_0, RATIOS_EXPLORATION_ID_0 ) - networkConnectionUtil.setCurrentConnectionStatus(ProdConnectionStatus.LOCAL) launch( createExplorationActivityIntent( internalProfileId, @@ -1099,20 +1096,18 @@ class ExplorationActivityTest { ) ).use { waitForTheView(withText("What is a Ratio?")) + networkConnectionUtil.setCurrentConnectionStatus(ProdConnectionStatus.LOCAL) + testCoroutineDispatchers.runCurrent() onView(withId(R.id.action_audio_player)).perform(click()) - onView( - allOf( - withId(R.id.play_pause_audio_icon), - withEffectiveVisibility(Visibility.VISIBLE) - ) - ) - onView(allOf(withId(R.id.audio_language_icon), withEffectiveVisibility(Visibility.VISIBLE))) + + testCoroutineDispatchers.runCurrent() + onView(withId(R.id.audio_bar_container)).check(matches(isDisplayed())) + onView(withId(R.id.audio_fragment_voiceover_progressbar)).check(matches(isDisplayed())) + waitForTheView(withDrawable(R.drawable.ic_pause_circle_filled_white_24dp)) onView(withId(R.id.play_pause_audio_icon)).check( matches( - withDrawable( - R.drawable.ic_pause_circle_filled_white_24dp - ) + withDrawable(R.drawable.ic_pause_circle_filled_white_24dp) ) ) }