diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 76262912c..15d2921a7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,18 +14,19 @@ jobs: coverageReport: strategy: + max-parallel: 2 matrix: - api-level: [21, 21, 30] + api-level: [21, 30, 21,30] fail-fast: false runs-on: macOS-latest steps: - name: checkout - uses: actions/checkout@v1 + uses: actions/checkout@v3 with: fetch-depth: 1 - name: create instrumentation coverage - uses: ReactiveCircus/android-emulator-runner@v2.14.3 + uses: ReactiveCircus/android-emulator-runner@v2.23.0 with: api-level: ${{ matrix.api-level }} arch: x86_64 diff --git a/app/src/androidTest/AndroidManifest.xml b/app/src/androidTest/AndroidManifest.xml index 3a75bc37f..db8066c1c 100644 --- a/app/src/androidTest/AndroidManifest.xml +++ b/app/src/androidTest/AndroidManifest.xml @@ -1,6 +1,9 @@ + diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/BaseRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/BaseRobot.kt index 679e592e8..81c8a5f25 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/BaseRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/BaseRobot.kt @@ -81,7 +81,7 @@ abstract class BaseRobot( private fun waitFor( findable: Findable, - timeout: Long = DEFAULT_WAIT + timeout: Long = VERY_LONG_WAIT ): UiObject2? = uiDevice.wait(Until.findObject(findable.selector(this)), timeout) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationRobot.kt index d12d6ac34..44bbab42c 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationRobot.kt @@ -17,6 +17,7 @@ */ package org.kiwix.kiwixmobile.main +import com.schibsted.spain.barista.interaction.BaristaSleepInteractions import applyWithViewHierarchyPrinting import org.kiwix.kiwixmobile.BaseRobot import org.kiwix.kiwixmobile.Findable.StringId.TextId @@ -36,6 +37,7 @@ import org.kiwix.kiwixmobile.page.history.HistoryRobot import org.kiwix.kiwixmobile.page.history.history import org.kiwix.kiwixmobile.settings.SettingsRobot import org.kiwix.kiwixmobile.settings.settingsRobo +import org.kiwix.kiwixmobile.testutils.TestUtils import org.kiwix.kiwixmobile.utils.StandardActions.openDrawer import org.kiwix.kiwixmobile.webserver.ZimHostRobot import org.kiwix.kiwixmobile.webserver.zimHost @@ -50,6 +52,7 @@ class TopLevelDestinationRobot : BaseRobot() { } fun clickReaderOnBottomNav(func: ReaderRobot.() -> Unit) { + BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS.toLong()) clickOn(ViewId(R.id.readerFragment)) reader(func) } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 9b5c75bf9..5848041bb 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -38,7 +38,7 @@ object Versions { const val org_jacoco: String = "0.8.7" - const val io_mockk: String = "1.10.2" + const val io_mockk: String = "1.12.0" const val android_arch_lifecycle_extensions: String = "1.1.1" diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index da773d305..71a01cfe8 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -11,7 +11,8 @@ - + ) : SideEffect() every { activity.getString(R.string.app_name) } returns "app" every { activity.getString(R.string.speech_prompt_text, "app") } returns "the app" - every { activity.startActivityForResult(any(), any()) } throws ActivityNotFoundException() + every { activity.startActivityForResult(any(), any()) } returns Unit mockkConstructor(Intent::class) StartSpeechInput(actions).invokeWith(activity) verify { - anyConstructed().putExtra( + constructedWith().putExtra( RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM ) - anyConstructed().putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()) - anyConstructed().putExtra(RecognizerIntent.EXTRA_PROMPT, "the app") + constructedWith().putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()) + constructedWith().putExtra(RecognizerIntent.EXTRA_PROMPT, "the app") activity.startActivityForResult(any(), StartSpeechInput.REQ_CODE_SPEECH_INPUT) } } diff --git a/custom/src/customexample/info.json b/custom/src/customexample/info.json index 495a11431..140e3b302 100644 --- a/custom/src/customexample/info.json +++ b/custom/src/customexample/info.json @@ -1,6 +1,6 @@ { "app_name": "Test Custom App", - "zim_url": "http://download.kiwix.org/zim/wikipedia_fr_test.zim", + "zim_url": "https://download.kiwix.org/zim/wikipedia_fr_test.zim", "enforced_lang": "en", "disable_sidebar": false, "disable_tabs": false,