mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Introduce android 13 CI in project
This commit is contained in:
parent
21c6a27881
commit
a0449efffa
28
.github/workflows/coverage.yml
vendored
28
.github/workflows/coverage.yml
vendored
@ -15,8 +15,7 @@ jobs:
|
||||
coverageReport:
|
||||
strategy:
|
||||
matrix:
|
||||
api-level: [21,30]
|
||||
target: [ google_apis ]
|
||||
api-level: [21,30,33]
|
||||
fail-fast: false
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
@ -41,20 +40,41 @@ jobs:
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: create instrumentation coverage
|
||||
uses: ReactiveCircus/android-emulator-runner@v2.23.0
|
||||
uses: ReactiveCircus/android-emulator-runner@v2.25.0
|
||||
env:
|
||||
GRADLE_OPTS: "-Dorg.gradle.internal.http.connectionTimeout=60000 -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.network.retry.max.attempts=6 -Dorg.gradle.internal.network.retry.initial.backOff=2000"
|
||||
if: ${{ matrix.api-level != 33 }}
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
target: default
|
||||
arch: x86_64
|
||||
profile: pixel_2
|
||||
ndk: 21.4.7075529
|
||||
ram-size: '4096M'
|
||||
disk-size: '14G'
|
||||
sdcard-path-or-size: '1000M'
|
||||
disable-animations: false
|
||||
script: bash contrib/instrumentation.sh
|
||||
|
||||
- name: create instrumentation coverage on google_apis for android 33
|
||||
uses: ReactiveCircus/android-emulator-runner@v2.25.0
|
||||
env:
|
||||
GRADLE_OPTS: "-Dorg.gradle.internal.http.connectionTimeout=60000 -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.network.retry.max.attempts=6 -Dorg.gradle.internal.network.retry.initial.backOff=2000"
|
||||
if: ${{ matrix.api-level == 33 }}
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
profile: pixel_2
|
||||
ndk: 21.4.7075529
|
||||
ram-size: '4096M'
|
||||
disk-size: '14G'
|
||||
sdcard-path-or-size: '1000M'
|
||||
disable-animations: false
|
||||
script: bash contrib/instrumentation.sh
|
||||
|
||||
- name: Upload screenshot result
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ matrix.api-level }}
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.help
|
||||
|
||||
import android.os.Build
|
||||
import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
@ -34,6 +35,7 @@ class HelpFragmentTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun verifyHelpActivity() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
runOnUiThread { activityRule.activity.navigate(R.id.helpFragment) }
|
||||
help {
|
||||
clickOnWhatDoesKiwixDo()
|
||||
@ -48,4 +50,5 @@ class HelpFragmentTest : BaseActivityTest() {
|
||||
clickOnSendFeedback()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.initial.download
|
||||
|
||||
import android.os.Build
|
||||
import androidx.core.content.edit
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
@ -53,6 +54,7 @@ class InitialDownloadTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun initialDownloadTest() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
UiThreadStatement.runOnUiThread { activityRule.activity.navigate(R.id.downloadsFragment) }
|
||||
initialDownload {
|
||||
assertLibraryListDisplayed()
|
||||
@ -64,6 +66,7 @@ class InitialDownloadTest : BaseActivityTest() {
|
||||
assertDownloadStart()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@After
|
||||
fun setPrefStorageOption() {
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.intro
|
||||
|
||||
import android.os.Build
|
||||
import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
@ -29,9 +30,11 @@ class IntroFragmentTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun viewIsSwipeableAndNavigatesToMain() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
runOnUiThread { activityRule.activity.navigate(R.id.introFragment) }
|
||||
intro(IntroRobot::swipeLeft) clickGetStarted {}
|
||||
}
|
||||
}
|
||||
|
||||
@Before
|
||||
override fun waitForIdle() {
|
||||
|
@ -19,6 +19,7 @@ package org.kiwix.kiwixmobile.language
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Instrumentation
|
||||
import android.os.Build
|
||||
import androidx.core.content.edit
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.test.ext.junit.rules.ActivityScenarioRule
|
||||
@ -67,6 +68,7 @@ class LanguageFragmentTest {
|
||||
|
||||
@Test
|
||||
fun testLanguageFragment() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
UiThreadStatement.runOnUiThread {
|
||||
activityScenarioRule.scenario.onActivity {
|
||||
it.navigate(R.id.downloadsFragment)
|
||||
@ -81,4 +83,5 @@ class LanguageFragmentTest {
|
||||
searchAndSaveLanguage("italiano", "Italian")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.main
|
||||
|
||||
import android.os.Build
|
||||
import androidx.core.content.edit
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
@ -49,6 +50,7 @@ class TopLevelDestinationTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun testTopLevelDestination() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
ActivityScenario.launch(KiwixMainActivity::class.java)
|
||||
topLevel {
|
||||
clickReaderOnBottomNav {
|
||||
@ -77,6 +79,7 @@ class TopLevelDestinationTest : BaseActivityTest() {
|
||||
pressBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@After
|
||||
fun setIsTestPreference() {
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.note
|
||||
|
||||
import android.os.Build
|
||||
import androidx.test.internal.runner.junit4.statement.UiThreadStatement
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
@ -35,6 +36,7 @@ class NoteFragmentTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun verifyNoteFragment() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
UiThreadStatement.runOnUiThread { activityRule.activity.navigate(R.id.notesFragment) }
|
||||
note {
|
||||
assertToolbarExist()
|
||||
@ -42,4 +44,5 @@ class NoteFragmentTest : BaseActivityTest() {
|
||||
assertSwitchWidgetExist()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.search
|
||||
|
||||
import android.os.Build
|
||||
import androidx.core.content.edit
|
||||
import androidx.core.net.toUri
|
||||
import androidx.preference.PreferenceManager
|
||||
@ -52,6 +53,7 @@ class SearchFragmentTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun searchFragmentSimple() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
UiThreadStatement.runOnUiThread { activityRule.activity.navigate(R.id.libraryFragment) }
|
||||
val loadFileStream =
|
||||
SearchFragmentTest::class.java.classLoader.getResourceAsStream("testzim.zim")
|
||||
@ -91,6 +93,7 @@ class SearchFragmentTest : BaseActivityTest() {
|
||||
checkZimFileSearchSuccessful(R.id.readerFragment)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@After
|
||||
fun setIsTestPreference() {
|
||||
|
@ -18,6 +18,7 @@
|
||||
package org.kiwix.kiwixmobile.settings
|
||||
|
||||
import android.Manifest
|
||||
import android.os.Build
|
||||
import androidx.test.internal.runner.junit4.statement.UiThreadStatement
|
||||
import androidx.test.rule.ActivityTestRule
|
||||
import androidx.test.rule.GrantPermissionRule
|
||||
@ -47,14 +48,17 @@ class KiwixSettingsFragmentTest {
|
||||
@Before
|
||||
fun setup() {
|
||||
// Go to IntroFragment
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
UiThreadStatement.runOnUiThread { activityTestRule.activity.navigate(R.id.introFragment) }
|
||||
intro(IntroRobot::swipeLeft) clickGetStarted { }
|
||||
StandardActions.openDrawer()
|
||||
StandardActions.enterSettings()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSettingsActivity() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
settingsRobo {
|
||||
assertZoomTextViewPresent()
|
||||
assertVersionTextViewPresent()
|
||||
@ -81,4 +85,5 @@ class KiwixSettingsFragmentTest {
|
||||
dismissDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package org.kiwix.kiwixmobile.splash
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.espresso.Espresso
|
||||
@ -66,6 +67,7 @@ class KiwixSplashActivityTest {
|
||||
|
||||
@Test
|
||||
fun testFirstRun() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
shouldShowIntro(true)
|
||||
activityScenario.recreate()
|
||||
activityScenario.onActivity {
|
||||
@ -86,9 +88,11 @@ class KiwixSplashActivityTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNormalRun() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
shouldShowIntro(false)
|
||||
activityScenario.recreate()
|
||||
activityScenario.onActivity {
|
||||
@ -100,6 +104,7 @@ class KiwixSplashActivityTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@After
|
||||
fun endTest() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user