Fixed: The testBookmarks failing on Android 13 and above.

This commit is contained in:
MohitMaliFtechiz 2025-05-16 15:43:45 +05:30
parent 0c91e329d4
commit 21583e76c0
3 changed files with 10 additions and 5 deletions

View File

@ -19,6 +19,7 @@ package org.kiwix.kiwixmobile.language
import android.Manifest import android.Manifest
import android.app.Instrumentation import android.app.Instrumentation
import android.os.Build
import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.junit4.createComposeRule
import androidx.core.content.edit import androidx.core.content.edit
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
@ -207,6 +208,8 @@ class LanguageFragmentTest {
) )
clickOnSaveLanguageIcon(composeTestRule) clickOnSaveLanguageIcon(composeTestRule)
} }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
LeakAssertions.assertNoLeaks() LeakAssertions.assertNoLeaks()
} }
} }
}

View File

@ -134,9 +134,9 @@ class LibkiwixBookmarkTest : BaseActivityTest() {
pressBack() pressBack()
// Test saving bookmark // Test saving bookmark
clickOnSaveBookmarkImage() clickOnSaveBookmarkImage()
topLevel { openBookmarkScreen()
clickBookmarksOnNavDrawer { assertBookmarkSaved(composeTestRule) } assertBookmarkSaved(composeTestRule)
} pressBack()
// Test removing bookmark // Test removing bookmark
clickOnSaveBookmarkImage() clickOnSaveBookmarkImage()
longClickOnSaveBookmarkImage() longClickOnSaveBookmarkImage()

View File

@ -161,7 +161,9 @@ class NavigationHistoryTest : BaseActivityTest() {
pressBack() pressBack()
pressBack() pressBack()
} }
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1 &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU
) {
// temporary disabled on Android 25 // temporary disabled on Android 25
LeakAssertions.assertNoLeaks() LeakAssertions.assertNoLeaks()
} }